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/
- Model Parallelism vs Data Parallelism: Examples - April 11, 2024
- Model Complexity & Overfitting in Machine Learning: How to Reduce - April 10, 2024
- 6 Game-Changing Features of ChatGPT’s Latest Upgrade - April 9, 2024
Leave a Reply