Answer the question
In order to leave comments, you need to log in
Microservice architecture for online games. Async issue?
I decided to remake my game server from a monolith to microservices. I write on nodejs communication, communication between nanomsg services. I decided to start by highlighting the Bots and all their logic of movement and state as a separate service. Approximately 10,000 bots.
It used to be that for each user the nearest bots are searched and their coordinates are sent to him, within the same service this is not a problem, with a microservice approach, the coordinates of the bots will come asynchronously and be lost. What is the best way to approach such a situation? Perhaps someone came across? I would be grateful for any advice or a link to an article.
Answer the question
In order to leave comments, you need to log in
Little information about what is and what you want. But in general, microservices do not assume asynchrony by default. But even with it, everything seems to be easy:
1. We raise the bot registration service based on any queue server
2. Users subscribe to messages about the appearance of a bot in their district
3. Bots send their coordinates to the service without waiting for a response (it, in principle, does not needed)
4. The service notifies users about the bots they are interested in.
By bots, you mean some kind of decision-making system, right?
If so, then this is just one of the components of the system, connected to others through events. And events can already be forwarded asynchronously through the message bus. You will simply have an event dispatcher that can scatter events among processes. The problem will only be in state synchronization, but this is solvable.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question