Scaling
The current architecture of the server will allow for sharding of server instances, we should leverage this to support high throughput
networking
load balancing with sticky sessions would be required to allow for multiple backends to be running
load balancers:
- HAProxy would probably be the best bet
- nginx also works for this
to manage multiple instances running, might want to experiment with Kubernetes for dynamic growing and shrinking of instances based on load
socket.io
socket.io has support for adapters to connect multiple instances together
events:
- pixel placement event should get batched together (all pixel placements <10ms ago, send at once or similar)
- maybe use namespaces to send one pixel placement at a time if zoomed in enough
adapters:
- redis streams - most likely use this one as it has redis server reconnection
- redis - no reconnection, but still works
other server state
a lot of state is stored within redis, but leveraging server-to-server events in socket.io might be a better options
Edited by Grant