K
K
Kenan2017-04-05 09:23:16
Software design
Kenan, 2017-04-05 09:23:16

How to synchronize data between the same microservices?

I read a book on microservice architecture, but did not understand one important thing, balancing between identical services.
Suppose we have several identical microservices between which the load is distributed, and in the event of a failure of one service, the application should continue to work as usual.
In the course of work, some other services write data to the ones mentioned above. How should data be synchronized between these identical services, because each has its own storage? Each of them should have all the data, and not just those that were written to it? How is this synchronization done?
Tell me, please, where to dig.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
K
Kenan, 2017-04-09
@nikchar

All figured out. I misunderstood the difference between a microservice and a microservice instance.
All instances of one microservice in most cases look at one database (or replica set), and the database itself is already scaled separately from the service instances.

D
dinegnet, 2017-04-05
@dinegnet

Microservices themselves do not store data.
They share a common database.
Or they have internal synchronization on the message bus.
Or, more practical, a shared database, then synchronizing changes over the message bus.

A
Anton Konovalov, 2017-04-05
@akonovalov

Apparently, a bunch of "identical" microservices are instances of the same microservice. The whole bunch can be hidden behind a proxy service (nginx, HAProxy, etc.) or your own self-made proxy-balancing microservice (since this is the trend now and everyone is rushing around microservices).
To synchronize this whole zoo, you can use a message broker, such as RabbitMQ.
PS I strongly recommend that you familiarize yourself with this manifesto

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question