Marco
Marco

Reputation: 49

Migrating a monolithic app to microservices, should I merge layers into a single one?

I am in the process of learning the complex world of microservices. I am migrating a traditional multilayer monolithic application written in .NET Core 8 to an application based on microservices. The monolithic application is based on Clean Architecture with its multilayer structure made of a minimal API project, an infrastructure project, an application project and a domain project. Once migrated, the microservices app should run in Docker containers in one of the services available in Azure.

After having more or less identified the bounded contexts to migrate to corresponding microservices, I have a doubt on which I haven't been able to find a clear answer. Admittedly, my knowledge is still rather confused because of the sheer quantity of information I am processing, so please correct if I am wrong. Anyhow, my understanding is that each layer that I migrate should run in a separate container. This concerns me because it increases the number of containers considerably more than I expected. So, my question is: is it ok to merge these layers into a single project? As I browsed some sample projects on GitHub, I have seen a few cases where apparently this seems to be the case. What are the best practices to deal with this matter?

Upvotes: 0

Views: 44

Answers (0)

Related Questions