Anonymous Asked in Cars &Transportation · 2 weeks ago

Is it a good idea for microservices to share a common database is yes or no?

Sharing a common database between multiple Microservices increases coupling between them. One service can start accessing data tables of another service.Should each microservice have its own database? - QuoraCan microservices share a common database? If the answer is no or .Can microservices share databases? - QuoraAre there any situations where one would use a shared database in .Другие результаты с сайта www.quora.com


Is it a good idea for microservices to share a common database?

I've seen folks refer to this idea in part, trivially, as “each microservice should own and control its own database and no two services should share a database.” The idea is sound: don't share a single database across services because then you run into conflicts like competing read/write patterns, data-model conflicts ...

Can microservices have common database?

Yes, it's possible to integrate a database for microservices. You can create a single shared database with each service accessing data using local ACID transactions.

Should microservices share common code?

The general guideline in microservices is to not share code. Things that can be shared are libraries that don't changed very often like US States, color, etc. To answer your question what about the code for the communication between the microservices , I would say not to share this code.

Should each microservice has its own database?

As you described it very well above, each microservice needs to own it's DATA, which could be held within a dedicated database, within a dedicated schema (within a database), or even a set of dedicated tables (within a schema within a database).

Related Questions

Relevance
Write us your question, the answer will be received in 24 hours