D
D
Darkhan Kamaliev2022-04-18 21:42:01
Service Oriented Architecture
Darkhan Kamaliev, 2022-04-18 21:42:01

How to host docker-compose for microservices on local development machine?

Good afternoon, I used to always work with monoliths on the local and raised one docker-compose backend + frontend and some services to catch up.
Now it's the turn of organizing microservices that could communicate with each other via http.
But I can't get the picture in my head of how it should look.
For example 1 docker-compose at the root with projects and start it? or? How to organize it "correctly"?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Pankov, 2022-04-19
@trapwalker

The main difference between microservices and a monolith is that they are more autonomous and isolated from each other. By the way, they can communicate with each other not only via http, more often this happens through RMQ queues or some kind of kafka.
If several microservices store data in one database or even in one table, then this somewhat worsens the isolation and your microservice architecture starts to smell like a monolith again, only such an intricate monolith, since you may want to take out the common code from the microservices in the next steps into some libraries, you will start importing the same models with different "microservices". And as a result, you will get the same monolith with all its shortcomings, and you will lose the advantages of the microservice architecture, while acquiring its disadvantages.
In addition, microservices that are simple in their design should be scaled horizontally if necessary, which will cause problems for the docker with its compose.
The best thing to do is to deploy a microservice architecture in kubernete.
At the same time, very often, unless of course you live in a mono-repository, the deployment configuration is configured in general in a separate project.
For development and debugging, you are usually isolated in your microservice, you may need a docker compose for developer needs, which will raise your database, nginx, queues, and what else you need there for local debugging and testing needs.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question