4 ms·
> Are microservices meant to separate data too? As in, each service has its own database. Ideally yes, to scale. Sometimes you have a service with obvious and
by ratww 6y ago
> Are microservices meant to separate data too? As in, each service has its own database.
Ideally yes, to scale.
Sometimes you have a service with obvious and easy-to-split boundaries, and microservices are a breeze.
Some things that are easy to turn into microservices: "API Wrapper" to a complex and messy third-party API. Logging and data collection. Sending emails/messages. User authentication. Search. Anything in your app that could become another app.
However, when your data model is tightly coupled and you need to choose between tradeoffs (data duplication), having bigger services, or even keeping it as a monolith.
Btw, if you don't care about scalability, sharing a database is still still not the best idea. But you can have a microservice that wraps the database in a service, for example. Tools like Hasura can be used for that.