How to implement context persistent storage?

A connection is established between the SDK and mediasoup through webrtc-transport, and the router class, transport class and forwarding relationship stored in the context in mediasoup-worker are generated.

When the worker restarts (normal release restart or abnormal restart is pulled up by the script), the connection between the SDK and the worker will be disconnected, and the worker context will also be lost during the restart process.

How to solve the problem of disconnection when the worker restarts, in a commercial project.

Is it possible to store key contextual information in persistent storage like shared memory, or a kv database?

This is just a discussion, thanks for the answer.

Just have your media servers connect to a signaling server, the signaling server stays online 24/7 even if remote disconnection. If signal server detects ping timeout or a disconnect over websocket tell users the server crashed and have them request a new stream.

If the media server loses connection at all it should exit process and restart it fresh or perform a clean-up/re-connect but easiest to exit and restart. This results in fast repair, when server recovers it rejoins the network while others would had already taken over, so if it was DDOS’d for instance… no fears.

1 Like