Monolithic Architecture or Microservices

Isuru Prabath
2 min readJan 5, 2023

--

This image was created with the assistance of AI art generators (DALL·E 2 & Stable Diffusion 1.5)

Hey, I am here to put my two cents on the monolithic architecture & microservices. 😁 So let me.

First, imagine you have a one big castle. This castle is a representation of the monolithic architecture, where all the rooms and functions are housed within the same structure. It’s like a one-stop shop for everything you need.

Microservices, on the other hand, are like a swarm of tiny houses scattered throughout a neighborhood. Each house serves a distinct function, such as cooking, sleeping, or entertaining️.

Let’s compare the two:

In the castle (monolithic architecture), you have to walk through long, winding corridors to get from one room to the next. It can be a pain to get from the bedroom to the kitchen in the morning! Furthermore, if you want to make any changes or updates to the castle, you have to go through the hassle of renovating the entire structure. Perhaps you’ll have to completely demolish the castle and rebuild it from scratch.

In the tiny houses (microservices), getting from one function to the next is as easy as walking through the front door and into the next house. Plus, if you want to make changes or updates, you can just focus on one specific house instead of the entire neighborhood. If you want to add another function, I’m talking about a new tiny house. It can be built separately without interfering with other houses. Then, open its door, enter it, and use it.

Let’s dive a little deeper into the technical differences and and come to a conclusion.

  • Monolithic architecture involves building all functions of a system as a single unit, which can be difficult to update and manage as the system grows in complexity.
  • Microservices are small, independent services that can be developed, tested, and deployed independently of each other, making them easier to update and maintain.
  • Microservices are easier to scale than monolithic architectures because they allow individual services to be scaled up independently without affecting the rest of the system.
  • Microservices are easier to test and maintain because they can be tested and deployed independently of the rest of the system, which makes it easier to catch and fix bugs and ensure that the system is running smoothly.
  • Microservices can be more complex to manage and more expensive to develop due to the need for coordination and integration among multiple services and the requirement for more code and developers.

So which is better? It really depends on your needs. The castle (monolithic architecture) may be simpler and easier to manage, but the tiny houses (microservices) offer more flexibility and are easier to update and maintain.

Bye! May your commits always build successfully.

--

--

Isuru Prabath

Programmer | Game Developer | Tech Enthusiast | Sri Lankan