Communications in Monolithic Architecture
In this article, we are going to learn Monolithic Architecture and Communications when designing any software architecture for our projects.
By this article, we are going to learn how to communicate between Modules in Modular Monolithic Architecture and Design our E-Commerce application with Modular Monolithic Architecture.
I have just published a new course — Design Microservices Architecture with Patterns & Principles.
Architecture Design Journey
There are many approaches and patterns that evolved over decades of software development, and all have their own benefits and challenges.
In the last article, we have learned and designed e-commerce application with Modular Monolithic Architecture style. Now we will focus on Vertical Considerations of Monolithic Application that you can see it the picture above. There are several vertical consideration that we are going to discuss:
- Communications
- Transaction Management
- Deployments
We are still in monolithic architecture and vertically we will learn
- How to communicate each other
- How to perform distributed transactions
- How to deploy on cluster
Communication of Monolithic Architecture
Monolithic architecture is a software design pattern where an application is built as a single, self-contained unit. In this architecture, all of the application’s functionality is contained within a single codebase, and all modules are tightly coupled, meaning that changes made to one module can have ripple effects throughout the entire system.
When it comes to communication in a monolithic architecture, the application components communicate with each other through direct method calls or function invocations, often using shared libraries and common databases. This means that communication is relatively simple and straightforward, as there is no need for additional communication protocols or tools.
As you know that, monolithic application sitting in the same server with all modules. So we don’t need to make any network call. So it is very easy and fast to communicate between modules of Monolithic Application.
- The communication will be inter-process communication.
Inter-process communication is the mechanism provided by the operating system that allows processes to communicate with each other. So that means communication performs by method calls into the code.
This communication could involve a process letting another process know that some event has occurred or transferring of data from one process to another. It Processes to communicate with each other by method calls into the code. Also asynchronous communication can be done in monolithic architecture with using message broker systems.
In a monolithic architecture, all of the application’s modules are deployed together on a single server or cluster, which means that the communication between modules happens within the same process, and there is no need for network communication.
However, as the application grows and becomes more complex, monolithic architecture can become harder to maintain, and changes made to one module can impact the entire system, which can result in longer development cycles and increased risk of errors. As a result, many organizations are moving towards more modular and distributed architectures, such as microservices, which allow for greater flexibility and scalability.
Design Modular Monolithic Architecture — E-Commerce App
If we design e-commerce application with Modular Monolithic architecture, you can see the image below:
According to architecture, we can encapsulate new feature developments into a module. And every module can implement its own architecture like Layered, Onion, Clean and so on.
Design Microservice Architecture — E-Commerce App
If we design e-commerce application with Microservice architecture, you can see the image below:
Product microservice can use NoSQL document database Shopping Cart microservice can use NoSQL key-value pair database and Order microservice can use Relational database as per microservice data storage requirements.
What’s Next ?
- Microservices Killer: Modular Monolithic Architecture
- Macro-services to Nano-services: Evolution of Software Architecture
- Microservices Architecture: Problems and Solutions with Pattern and Principles
Step by Step Design Architectures w/ Course
I have just published a new course — Design Microservices Architecture with Patterns & Principles.
In this course, we’re going to learn how to Design Microservices Architecture with using Design Patterns, Principles and the Best Practices. We will start with designing Monolithic to Event-Driven Microservices step by step and together using the right architecture design patterns and techniques.