T
T
topuserman2021-10-10 11:48:13
Docker
topuserman, 2021-10-10 11:48:13

Docker: one service, one container?

Another question from the microservices and docker series:

the main ideology when building microservices architecture on docker says that one service should be in one container.

putting mysql and rabbimq into one container is a bad idea (because it will be difficult to monitor two services inside one container, and it will be necessary to install a supervisor inside - and this is not good), and it is better to distribute it among different containers.

and if I have 10 microservices, each with its own database, then I need to have 10 containers in addition to everything, each of which will contain only mysql ?

I do not quite understand what it is for? And then how not to get confused in all this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vasily Bannikov, 2021-10-10
@vabka

and if I have 10 microservices, each with its own database, then I need to have 10 containers in addition to everything, each of which will contain only mysql ?

Yes. 10 containers for applications and 10 for database.
True, putting a database into containers is not a good practice, because they often need to quickly access the disk, and all sorts of dockers and kubernetes add a bunch of overhead (or a bunch of work for ops).
Often, a DBMS installed on a separate machine + a couple of replicas is more than enough for all services.
I do not quite understand what it is for? And then how not to get confused in all this?

How not to get confused - you give normal names to all things.
I do not quite understand what it is for?

Docker or pushing only one process into a container?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question