A
A
Alexander Lavrov2018-10-08 21:04:28
Python
Alexander Lavrov, 2018-10-08 21:04:28

How to synchronize the DB model between microservices?

So, there is a modela.py file where the table models are stored in the database. There are several microservices that use these models. The question is how, when the model was changed, synchronization between mikooseovis occurred. Despite the fact that they are on different servers, and the code base is in different repositories.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey Gornostaev, 2018-10-08
@sergey-gornostaev

Combine the data access logic into a separate module and move it to another repository.

I
Ivan Shumov, 2018-10-08
@inoise

I don’t know what is in python, but php has private composer packages, and nodejs has private npm packages. I bet it should be the same

J
Jhn Doe from, 2018-10-27
@spbislanders

With microservices, as far as I can see it: 1bd for all tables, for each table you have 1 repository, 1 table, 1 model in the application describing this table, 1 resource. Of course, all repositories are private.
Before all this zoo from a heap of services, put api gateway.
How you will link data between these tables - no idea. You can do this manually, instead of a database, you can move all models to 1 repository, and install it in the necessary services.
I thought that it was necessary to live up to microservices, then there would be no such questions, or that someone in the team had experience in setting up this zoo

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question