From what I researched, the preferred architecture for microservices is polyglot persistence pattern. (http://martinfowler.com/bliki/PolyglotPersistence.html ). You could further read about this on following pages:
- http://martinfowler.com/articles/microservices.html#DecentralizedDataManagement
- http://microservices.io/patterns/data/database-per-service.html
As per the best practices, each micro-service should have one database private to it. There are different ways to achieve the above objective. Some of them are listed below:
- Same database system for different services. In this following could be done:
- Different set of tables specific to microservice in the same database
- Different database schema but in the same database server
- Different database server
- Each service can use different database systems. For example, RDBMS, MongoDB etc.
Following diagram represents one datastore per microservice. (courtesy: MartinFowler page on MSA)
Following is another page representing MSA best practices from NetFlix. It highlights creating separate datastore for each microservice.
https://www.nginx.com/blog/microservices-at-netflix-architectural-best-practices/
- Agentic Reasoning Design Patterns in AI: Examples - October 18, 2024
- LLMs for Adaptive Learning & Personalized Education - October 8, 2024
- Sparse Mixture of Experts (MoE) Models: Examples - October 6, 2024
I found it very helpful. However the differences are not too understandable for me