D
D
Denis Antonenko2017-09-06 17:33:22
Highload
Denis Antonenko, 2017-09-06 17:33:22

How to provide fault tolerance and load balancing in services + JMS (messaging bus)?

In the classical implementation of the microservice architecture, services receive a message and process it and spit it out further (stateless). The issues of load sharing and fault tolerance are solved by using queues and running multiple instances of the service. But in practice, we encountered a synchronization problem.
Let's say we have a set of objects that describe the state machine, states and transitions between states. At the moment we have one service which is responsible for handling transitions between states for all objects. When transitioning to a new state, the service sends a message to other microservices. At startup, we unload all objects from the database and run the state machine.
Accordingly, we cannot simply launch 3 instances of the service - all three will subtract the same set of objects and will perform the same transitions - at the output, all three will send 3 identical messages.
Hence a number of questions:

  1. Are there classical solutions for this problem?
  2. Are there any reliable synchronization mechanisms using the message bus (JMS similar)?
  3. Are there classic solutions for balancing and ensuring fault tolerance of statefull services?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question