Microservices vs Monolithic architecture

Bhagwati Malav
Dec 16, 2017 · 4 min read

Microservices architecture is getting lot of attention these day and being used by Uber, Netflix, Linkedin and many other other companies. I am sure you would have worked on various application which use monolithic architecture. There are considerable problems with monolithic architecture which we wont face if use microservices architecture. We face lot of problems in terms of deployment, scaling, understanding huge code base , moving to new framework, continuous delivery of new features, in term of coupling between components etc.

Microservices architecture allow big application to divide into small, loosely coupled services. It comes up with lot of benefits which we are going to discuss here.

  1. Lets say you have one e-commerce application which was developed using monolithic architecture, and over the time it has grown with lot of new features. Now codebase became huge and few set of people going to join your team. It is very difficult for them to get started with given application as there is no clear separation between various components of application. Now after spening lot of time, they added few bug fixes to existing codebase. There are high chances of breaking existing features as it is very complex and you need to be very careful in term of making changes in existing codebase. It might take lot of time, and you wouldn’t be confident even after spending lot of time. Microservices alllows you to see your application in terms of small, loosely coupled components, anyone can get started with existing application in short span of time and, it wouldn’t be too difficult to add new fix to codebase. You should have well written documentation for each microservice which covers all the apis.
  2. Imagine today you are running promotion. So you would be getting huge amount of traffic. And somehow your message component broke. It will affect whole application, and it will cause whole application to go down. If same happens in microservices architecture, you won’t face such failures as it runs multiple services independently so even if one goes down, it won’t affect other services. And it would not have huge impact on business unless it is not category/tier 1 microservice.
  3. You are group of people who spent lot of time in terms of understanding your application codebase. you guys existed about adding new features ex. product trending features, search etc. You have to redeploy whole application to show this features to end users. And you would be working on many such features, just think about the time it is going to take every time in deployment. So if your application is huge, it takes lot of in building, deployment etc which definitely cause loss of your productivity. Nobody likes to wait for 10 minutes or more and then see the result of code changes. In microservices architecture we try to make codebase as small as possible in each service so it doesn’t take much time in terms of building, deployments etc.
  4. Today you getting huge amount of traffic, and nothing got broken, servers are up. Lets say we need to scale any one components here ex. payment, you can’t scale individual component in monolithic architecture. In microservices architecture you can scale any component separately with adding more number of nodes dynamically.
  5. You started with some old framework initially, and now if you want to move to new framework, or technology stack. It becomes very difficult in monolithic architecture as it has become very big, complex over the time. It is not that difficult to achieve in microservices architecture.

That’s how microservices architecture makes your life easy. There are various strategies available which help you in diving application into small services ex. decompose by domain driven design, decompose by business capability etc. I would strongly recommend anyone who is just starting with microservices architecture to go through below given case studies :

Everything comes up with pros, cons, and microservices architecture has cons too. I would keep writing about microservices, various design patterns available in microservices architecture, event driven architecture in future.Thank you so much for reading this.

Hash#Include

Bhagwati Malav

Written by

Coder. An ardent music lover. An avid reader.Have penchant for Microservices, Distributed System, building highly scalable applications.

Hash#Include

Programming, Microservices, design, life lesson and more !!!

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade