Answer the question
In order to leave comments, you need to log in
How to consolidate distributed game servers?
Let's say a simple browser quiz. Connect to the server via WebSocket and send responses.
Time game. Everyone had a question, 10 seconds to think and choose an answer.
The server accepted the answers, sent out statistics to everyone: option A: 100 people, option B: 200.
Just until 100 thousand participants break into it. You have to scale.
Multiple servers. Each maintains its own pool of WS connections == pool of players.
Player data is only in the memory of this server.
Question time is over. We need to collect general statistics between all servers and send each to our players.
What pattern(?) is there for this situation?
So far 2 options have come to mind.
Answer the question
In order to leave comments, you need to log in
A single-layer structure, in theory, can be more stable than a dedicated server structure.
Most likely, one server per eye is enough for such a task.
If you need to scale, then make several identical cars with a common base and a balancer in front of them.
1. Sending answers to questions - via POST.
2. Receiving server events by the browser (new question, timer sync, who is online?) - websocket.
3. The rest is GET.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question