Understanding the architecture differences in monolithic and microservice
when we are developing a project then architecture will be going to take an important part in the whole development journey. So, I think no developer wants to ruin there night in office for the late release pressure. And sometimes the company faces big business loss and in some scenario developers lose their jobs. So, let’s start the main topic of this blog to understand the differences in architecture.
Understanding Monolithic Architecture
Food to Go, Inc. (FTGO) initially used a monolithic pattern when launched as a food delivery service. They are using monolithic architecture in the starting of the project.
Their application contains all the modules like order management, restaurant management, delivery management, payment in a single java application. In starting that architecture is good for there business software development because they have a small team to work on application but as the application gets popular in the market then they require more new functionality for there simple application. After launching and getting popular in the market they start hiring more developers and then they find most of the time they miss the deadline which affects the business in the long run.
Because of more teams for different modules development on the same codebase causes monthly production deployment in the place of daily or weekly deployment. And that causes testing was a headache for them. So, development need not be dependent on these thing’s which creates the monolithic hell for large projects. When the team size increases then most of the time get waste on the discussion part because everyone needs to be agreed on for the implementation approach. But we don’t want to waste valuable time in this competitive market.
Understanding MicroService Architecture
Before starting the topic, First, we need to understand the MicroService by some example to understand the architecture.
MicroService can be represented by a hexagonal architecture that contains the business logic with a separate database and way to communicate like APIs, message broker, gRPC.
Now, we need to understand what is microservice on the level of scaling cube.
The X-axis of the s-cube denotes the scaling of the application which can be done for monolithic as well. We can also say load balancing. So, Do not mix the load balancing with microservice. We can do load balancing for monolithic and microservice both.
Creating multiple instances of a single application is termed as load balancing which uses a load balancing algorithm for routing on instances like (RoundRobin algorithm).
The Y-axis of the scale cube denotes the scaling of the application by splitting function decomposition or code splitting. And that thing comes under the microservice because we are splitting the single application into multiple applications based on modules (like a food delivery application contain order module, a payment module, cart module, customer module).
And the Z-axis of the scale cube denotes the partitioning data by similar things or splitting of data on database data views.
So, we need to focus on the Y-axis of the Scale cube which shows scalability on the code level and that is termed as microservice when separated into multiple services with there own business logic. So, what we understand till now is microservice is splitting of modules into multiple applications. And when those services communicate with each other then that whole architecture is termed as MicroService Architecture.
In the next post, we will understand the communication pattern in the Microservice.
Reference Book Source – Microservice Patterns by Chris Richardson