I have hobby project which is a backend for a quiz game where up to 100 000 players can participate in a single game. For this to work the platform have to be very scaleable, performant and resilient. I need some help designing this on a higher level.
Here is what I currently have in mind for the design:
- Rest-api; a stateless app scaling horizontally.
- Ws-api; a stateful app with server-sent-events connections, scaling horizontally.
- Moderator; Receives events from Rest-Api, does computations and creates new events for ws-api. This service has less need of scaling but can do it.
Also using ActiveMQ for publishing and subscribing to events.
Current flow: Moderator receive events on an ActiveMQ queue and published events to ws-api on a ActiveMQ topic.
The problem: The problem is that the moderator service does not know when ws-rest is done pushing a certain event to all the players. The synchronisation between all the ws-rest nodes. How do multiple instances report back to a single node without blocking threads in a resilient way?
It's hard to fight evil. The little things, like a nice sandwich, really helps. Right tiny ad?