Backend for Frontend pattern - Challenges and Pitfalls - Exams of ASP.NET - Managing the shopping cart

What are traditional Monoliths? – Modular Monolith

In a traditional monolithic architecture, we build the application as a single, indivisible unit. This leads to the functionalities being tightly coupled together, making it difficult to make changes or scale specific features. This approach makes creating a big ball of mud easier, particularly when the team invests little effort in domain modeling and analysis before and during development.On top of that, while this approach is simple and straightforward, it lacks the flexibility and scalability of more modern architectures.

A monolith does not have to be indivisible, yet most end up this way because it is easy to create tight coupling in a single application.

Let’s look at microservices next.

What are microservices?

Microservices architecture, on the other hand, takes modularity to the extreme. Each service is a completely independent unit, running in its own environment. Microservices architecture allows for high scalability and flexibility but comes at the cost of increased operational complexity.

Chapter 19, Introduction to Microservices Architecture, covers this topic more in-depth.

The following sections delve deeper into this emerging architectural style, starting with its advantages.

Advantages of Modular Monoliths

One of the best things about Modular Monoliths is that they are easy to manage. You don’t have to worry about many moving parts like with microservices. Everything is in one place but still separated into modules. This makes it easier for us to keep track of things and to work with them.With Modular Monoliths, each module is like its own small project. We can test, fix, or improve a module without affecting the others. This is great because it lets us focus on one thing at a time, which improves productivity by lowering the cognitive load required to work on that feature.When it’s time to release the software, we only have one application to deploy. Even though it has many modules, we treat them like one deployable unit. This makes managing deployments much more straightforward as we don’t have to juggle multiple services like we would with microservices.Modular Monoliths can save us money because we don’t need as many resources since we deploy a single monolith. Because of that, we don’t need a team to manage and run complicated infrastructure. We don’t need to worry about distributed tracing between our services, which reduces the upfront monitoring cost. This deployment style is highly beneficial when starting a project with a small team or if the team is not proficient with microservices architecture.

Modular Monoliths can still be valuable even if you are part of a large team, part of a larger organization, or have experience with microservices architecture. It is not one or the other kind of scenario.

As we just explored, Modular Monoliths bring many advantages:

  • The reduced operational complexity makes deploying a complex application as a single unit easier than microservices.
  • They improve our development and testing experience because of their simplicity, improving our efficiency.
  • They are easier to manage than most traditional monoliths because modules are well segregated.
  • They are more cost-effective than microservices.

The following section looks at what makes up a Modular Monolith.

Leave a Reply

Your email address will not be published. Required fields are marked *