4 ms·
Ugh, how do you shard websocket connections when you have more connection than 1 server can handle ?
by ddorian43 11y ago
Ugh, how do you shard websocket connections when you have more connection than 1 server can handle ?
- ianlevesque 11y agoIt's not ideal for sure but you can use DNS to divvy it up by adding several IPs to your domain name.
- jmtulloss 11y agoYou can also do it out of band and have an API call that returns the server you're supposed to be connected to.
- al_chemist 11y agoIf you use Elixir/Phoenix, you can have many servers running same code, connected with each other as Erlang nodes. When client wants to broadcast something in whole network, it is broadcasted locally but is also sent do all servers and servers broadcasts it to their local clients. It's very easy to write.