Answer the question
In order to leave comments, you need to log in
Is it right to run a database server for each microservice?
Docker's philosophy is that "one process = one container". Since microservices can have a database and a load balancer, this is already more than one container. Is it correct to run a separate container with a database server and its own balancer for each microservice, or one container of a database server for all microservices?
Answer the question
In order to leave comments, you need to log in
I mean one database not for each individual microservice instance, but for all instances of some microservice. Let's say 10 microservice containers with one DB connection string. Accordingly, 1 balancer for this group.
The base is on its own, the microservice is on its own.
The base can have its own cluster with base replication across its nodes. A microservice has its own cluster, with its own containers. As a result, both the database and the service can be scaled out depending on what is not fast enough.
The main point of containers is to quickly deploy something in its environment, without long preparation of this environment and with minimal resources spent on this environment.
And the balancer itself is generally part of the functionality of the cluster or network subsystem, and not directly of the container.
As already mentioned, the database is a separate service. If a base is needed, a service is written to communicate with it and other services communicate through it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question