Monolithic Architecture: What, Why and When

Adeel Sarwar
The Startup
Published in
4 min readAug 12, 2020

--

Monolithic architecture is the classic way of software development. In a monolithic application, all components are built as a single code base and deployed as a single file. All of us, at some stage in our career, have designed and developed a monolithic architecture based application.

What is Monolithic Architecture?

Most of the time, a software is a combination of different feature set. In the monolithic architecture, all features of a software reside in a single code base, and deployed as a single file. If any code updates are required, then those updates can’t be accommodated independently. Developer has to use the same code base, make the required code changes and then re-deploy the updated code. So even if a single change is required, the whole code base is touched and re-deployed.

Types of Monolithic Architecture:

There are mainly two types of Monolithic Architecture:

Single Process Monolithic Architecture:

If all code of an application is deployed as a single process, then this type of architecture is called Single Process Monolithic Architecture.

Monolithic Application
Monolithic Architecture

Most of the classic applications in the industry are based on this architecture.

Modular Monolithic Architecture:

In this variant of monolithic architecture, a single application process consists of multiple modules. Each of these modules can work independently. The modules have interfaces and can communicate with each other through these interfaces. The underlying database is the same, and all of the modules use the same database for all operations. But still, all of the modules need to be combined in to form a single file for deployment.

Modular Monolithic Applications
Modular Monolithic Architecture

Modular Monolithic Architecture is considered as a better architecture than Monolithic Architecture. But if we compare Modular Monolithic with Microservices then definitely Microservices are better. But all organization don’t have skills and time to implement Microservices. So Modular Monolithic works for them and meets their requirements. Specially if module boundaries are well defined and a high degree of parallelism can be achieved then modular monolithic application architecture is considered as a good architecture. One of the great examples of the organizations who have used this architecture is Shopify. You can watch the talk on YouTube.

Why Monolithic Architecture?

Monolithic architecture has its Pros and Cons.

Advantages of Monolithic Architecture:

  • It’s simple to develop as there is either no modularity or less formal modularity.
  • It’s easy to deploy as one single file is deployed.
  • There are less security concerns as software consists of single code base.
  • Because of the single code base, there is no network latency so application has better performance.
  • It’s easy to track bugs and do end-to-end testing because of single code base.

Disadvantages of Monolithic Architecture:

  • When a bug affects a single aspect of the codebase, it affects everything.
  • Even if a small change is required, then whole application needs to be redeployed.
  • Thorough regression testing is required even if a small change is made.
  • You cannot scale the components, you have to scale the whole application. So if a single feature of the application is facing users load, and we have to deploy the feature on multiple servers for load-balancing then we can’t deploy that single feature/module on a separate server. We have to deploy the whole application on the separate server. This is very inefficient use of resources.
  • There are technology up-gradation barriers. If you want to use a new technology or framework, you can’t do that in part of the application. You have to re-write the whole application.
  • As codebase size increases, it becomes difficult to manage code and overall deployment time also increases.
  • If a new developer joins the project, it’s very difficult for him to understand the code and workflows.

When to use Monolithic Architecture?

Though there are more disadvantages of monolithic architecture, but still there are business use cases, where using monolithic architecture is a good choice. Some of them are discussed below:

  • If you are a startup, your team is small and you don’t have architects and the team required to implement complex architecture, then it make complete sense to go for monolithic architecture. Monolithic architecture can meet your business requirements, and you can always change the architecture when you have the required resources.
  • When you are developing a business proof of concept then rather than going into too much modular approach or microservices, it’s good to use monolithic architecture to complete proof of concept as soon as possible with less complexities.
  • If your application is simple, small, does not contain much business logic and so does not need modularity and scalability, then Monolithic Architecture is for you.

--

--

Adeel Sarwar
The Startup

CTO | HealthCare IT | Digital Transformation Leader | Outcome Driven Leader | Blogger | Speaker | Professor