What is the best practice for deploying a database in a microservice architecture, more specifically in a distributed environment such as docker? The principles of microservices state that each service must be idle in order to provide scalability. Since the database obviously has a state, should it work in a fixed position outside the cluster, deployed and configured before the cluster is initialized?
I got confused because all the docker examples include the database container in the service definition. But it’s not so simple. Often a database needs a lot of configuration before it is ready for use. In addition, the docker sucks in when coordinating the order in which the service starts.
If it’s really good practice to deploy a database along with docker-docker services, how to ensure consistency and consistency of critical data?
source
share