A monolithic architecture is a software architecture in which all the components of an application are combined into a single executable or deployment unit. In other words, a monolithic application is a unified system where all the different modules and functionalities are tightly coupled and run on a single server or platform. Typically, this type of architecture is built using a single programming language and a common data storage layer.
In a monolithic architecture, any change to a single component or module requires the entire application to be rebuilt, retested, and redeployed. This can lead to slower development and deployment cycles, as well as a lack of scalability, as the application may not be able to handle increased traffic or functionality demands. However, monolithic architectures are often simpler to design, develop, and maintain than more distributed architectures, making them a popular choice for smaller-scale applications or teams with limited resources.
There can be multiple types of monoliths:
- Single-process monolith: A single-process monolith is a type of monolithic architecture where the entire application is contained within a single process, typically running on a single machine. This means that all the application components are tightly coupled and communicate with each other through in-memory method calls or function invocations. In a single-process monolith, all the code is deployed as a single unit and is typically managed as a single application. This can make it difficult to scale, maintain, and evolve the application over time, as changes to one part of the application can have unintended consequences for other parts.
- Service-oriented monolith: A service-oriented monolith is a type of monolithic application architecture that uses a service-oriented approach to structure its internal components. In this architecture, the application is divided into different components or services, each of which is responsible for a specific set of functions or capabilities. However, unlike a microservices architecture where each service is independently deployable, in a service-oriented monolith, all services are deployed as a single application. The services may communicate with each other through direct function calls or by sharing a common data store. This architecture allows for some level of separation of concerns and can improve the scalability and maintainability of the application compared to a traditional monolithic architecture. However, it still retains many of the drawbacks of a monolith, such as limited agility, lack of flexibility, and increased complexity.
- 3rd party monolith: A third-party monolith refers to a monolithic application that is not owned or maintained by the organization using it, but is instead provided by a third-party vendor. In other words, the monolithic application is built by an external organization and is licensed or leased to the organization that uses it. The third-party monolith can provide functionality such as a customer relationship management system, an enterprise resource planning system, or a billing system. It is called a monolith because it is a single, large, tightly-coupled application that provides multiple functions and services.
- Distributed monolith: A distributed monolith is a monolithic application that is deployed across multiple physical or virtual machines, but still behaves like a monolith in terms of its architecture and design. In other words, it is a monolithic application that has been distributed across a network. A distributed monolith may have multiple instances of the monolithic application running on different machines, but all of these instances share a common codebase, database schema, and tightly-coupled components, which can make it difficult to modify and scale the application.
- Modular monolith: A modular monolith is a type of monolithic architecture that is structured in a way that allows it to be broken down into smaller, more manageable modules or components. It still runs as a single application but is designed to have clear module boundaries and interfaces, making it easier to scale and maintain over time. The idea behind a modular monolith is to achieve the benefits of a microservices architecture, such as flexibility and scalability, while still keeping the simplicity and ease of development that comes with a monolithic architecture.