M
M
MiyRon2021-06-26 11:01:26
Load balancing
MiyRon, 2021-06-26 11:01:26

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

3 answer(s)
R
Roman Mirilaczvili, 2021-06-26
@2ord

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.

S
Saboteur, 2021-06-27
@saboteur_kiev

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.

A
Artem Pastukhov, 2021-06-27
@past

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 question

Ask a Question

731 491 924 answers to any question