# System design

* [How to implement a distributed and auto-scalable WebSocket server architecture on Kubernetes](https://medium.com/lumen-engineering-blog/how-to-implement-a-distributed-and-auto-scalable-websocket-server-architecture-on-kubernetes-4cc32e1dfa45)
  * how to find a sender id if it is not found locally&#x20;
    * Pub/Sub solution (can be expensive)
    * rendezvous hashing taking instance\_ids (from K8s API) and sender\_id (looks better)
  * how to load balance WebSocket re/connections&#x20;
    * least\_connection algorithm to balance connections to new instances
    * clients may need to be able to reestablish WebSocket connections
