Monolithic vs Microservices Architecture

Sugeng Winanjuar
Life at Telkomsel
Published in
4 min readDec 22, 2022
Monolithic vs Microservices Illustration. Image credit: https://progressivecoder.com/wp-content/uploads/2019/03/microservices-arch.png?ezimgfmt=ngcb1/notWebP.

TL;DR. Basically, it’s easier to split into many than combine into one. So, just start with monolithic architecture for building simple and lightweight application. Then recognize the conditions that indicate we should migrate into microservices architecture.

Monolithic Architecture

Definition

Monolithic architecture is a traditional software development approach where the entire system function will be compiled into single application, so that the application runs all the required processes. In monolithic architecture, the application doesn’t depend on other application and doesn’t require API for communication between its components.

Generally, each application consist of three layers: presentation, business logic and data access layer. These layers build in a stack that are interrelated to build particular component or process.

Image from author.

In a single application monolithic, of course there can be many components related with it. Such as authenticator, notification manager, reporting component, scheduler, formatter, other components, etc.

Image from author.

Advantages

Monolithic architecture has many benefit, such as:

  1. Simple to develop. With a single application in place, of course fewer concerns with session, caching, memory management and allocation, etc.
  2. Simple to test. Since it is a single application, it is easier to perform automated testing and debugging, without taking into different run-time environments.
  3. Simple to deploy. Just have to upload the latest packaged application into server.
  4. Simple to scale out. Just running multiple copies behind a load balancer.
  5. Simple to trace. Monolithic application does not involve API, Messaging, or Event for the communication between components, which means flow process clearly described.

Disadvantages

Monolithic architecture has also many drawbacks, such as:

  1. Difficult to understand. Application is too large and complex to fully understand, especially for newcomers.
  2. Extremely low scalability. Scaling can only be done as a whole application, because the scaling of individual components is not possible.
  3. Difficult to continues deployment. Have to redeploy the entire application on each update.
  4. Tight coupling. Single application handle all required process or services, so codebase become much more complex as the application grow.
  5. Single point of failure. If any bug or something goes wrong in a single component or process, it could bring down the entire application.
  6. Potentially stagnant. Monolithic architecture has a barrier for adopting new technologies. Since changes in frameworks or languages will affect an entire application.

Microservices Architecture

Definition

Microservices architecture is a software development approach based on larger application build as a collection of small, lightweight, and single-purpose stand-alone units component. Each component is a small application has its own architecture consists of business logic, encompasses its own data, with no dependencies on other components. Those components (called as microservice) can communicate each other using REST API, RPC, Messaging Queueing, etc.

Image from author.

Advantages

Microservices architecture has many benefit, such as:

  1. Faster development. Keep it small and lightweight to make teams focus to build and test specific system elements. It also easier to understand, easier to maintain, easier to troubleshoot when issue production occured.
  2. Independent deployment. No need to redeploy the entire application on each update, just redeploy specific component. Continues deployment is possible for complex applications.
  3. High reliability. A failure in one component will not cause other component (moreover entire system application) malfunction.
  4. Scaled independently. Using container platform technology, each component can be scaled out and scaled up easily and independently.
  5. Reusable modules. Each component can be reused and reprofiled for other purposes and tasks.
  6. Agility. Microservices architecture reduces barrier of adopting new technologies since the developers are free to choose whatever technologies make sense for each component.

Disadvantages

Microservices architecture has also many drawbacks, such as:

  1. Distributed system design is challenging. By the fact that a microservices application is a distributed system, we need to choose an inter-process communication mechanism for each component to handle partial failure.
  2. Increased operational complexity. With the increased number of modules comes higher operational complexity and the deployment process becomes more convoluted.
  3. Testing become more complex. For a similar test for a service, we need to launch that service and any services correlated with.

Head to Head Comparison

Image from author. Raw table in gsheet.

Conclusion

At the beginning, it is much easier to go with monolithic architecture since it is simple to do the development. It is simple to test, and it is simple to deploy. But this simplicity approach has a lot of limitation in size and complexity. When application getting bigger and bigger, split the application into a set of smaller and interconnected services, which is well known as microservices architecture.

References

[1] Bhanuka Dissanayake, Monolithic vs. Microservices Architecture, 2019.
[2] Rich Marshall, To Monolith or to Microservice, 2020.
[3] Veselin Mijuskovic, Monolithic VS Microservices: Which App Development Architecture To Use, 2021.

--

--

Sugeng Winanjuar
Life at Telkomsel

Father. Husband. Employee. Enterpreneur. Belongs to Allah.