4 ms·
There is no microservices protocol description or RFC so its hard to say anything definitive, but yes you are right. We typically like to have a DB table (or M
by jmartrican 8y ago
There is no microservices protocol description or RFC so its hard to say anything definitive, but yes you are right. We typically like to have a DB table (or Mongo collection) owned by 1 microservice. This allows changes to be made to the underlying datastore without affecting multiple applications. The other apps that need data, just get it from the microservice without caring about how the microservice handles it.
I am in a team now that is just started using to use microservices. And I am noticing that we are stuck on a lot of DB changes we want to make because there are various applications accessing the same tables. So now we are getting into the habit of constraining back-end data stores (tables and collections) to just one microservice because we feel the pain of not doing that now.
- heavenlyblue 8y agoMicroservice is a monolith. So what you're describing is essentially: I've got a few front-end microservices tied to 1 huge microservice I call the database. There's no "data layer" that is managed outside the microservice. It _is_ a microservice. That's one of the reasons Google uses a monorepo: any microservice can easily import a database instance and start using it as part of it's structure.
- amirouche 8y agoWhat do you mean by 'database instance'? Is the the instance of the 'class' that represents the database and its records or something else?