I’ve been busy this week. I hope I can get some rest on the weekend.
learn.microsoft.com - Data considerations for microservices
The first section gives me a broad understanding of how data management works in a microservice setup.
Note It’s fine for services to share the same physical database server. The problem occurs when services share the same schema, or read and write to the same set of database tables.
reddit.com - Does Microservices architecture requires a database for each one ?
I love the tone of the top-voted answer—it provides a concise summary of the issues with sharing common tables across multiple microservices, while also acknowledging that it can be acceptable in real-world scenarios.
Microservices are architectural/design pattern, where services are:
- Independently deployable
- Loosely coupled
- Organized around business capabilities
By having common tables you are violating all 3 of those properties, because if you make breaking changes to table, you:
- need to deploy multiple unrelated microservices
- microservices are now tightly coupled with DB model
- multiple services serve same business domain.
microservices.io - Pattern: Database per service
Keep each microservice’s persistent data private to that service and accessible only via its API. A service’s transactions only involve its database.
TODO: