Develop_SP
Develop_SP

Reputation: 402

How do I manage multiple databases on microservices?

Create a single database for different microservices is anti-pattern, then the correct way is to create a database for each microservice. But when the database is a relational type, I will duplicate tables that have relationships between the microservices, but how can I have two different databases sync with each other? Thinking an application in Node with database postgres where I have products, clients and sales, three microservices, sales need clients and products then how I maintain my databases sync?

Regards!

Upvotes: 6

Views: 6809

Answers (1)

V. Mokrecov
V. Mokrecov

Reputation: 1094

This is one of the main problems in the micro service architecture that is being addressed using the pattern:

Also associated with this pattern are:

But this solves only part of the problem.

Building a micro service architecture is a very complex and extensive task, and it is associated with many problems and design patterns that allow you to minimize these problems. I recommend reading a book "Microservices patterns" that looks at various patterns of micro-service architecture design.

Upvotes: 4

Related Questions