Why do we microservice?

Well Microservice word itself explains micro + service which is the breaking down of services into individual independent one. It's an architectural pattern on designing the system and its flow.

But why do we need to microservice? Well let me explain with an example

Let's say someone wants to build an eCommerce application for a single country with no shipping. Initially, he wants to launch eCommerce store with limited 100+ products only with, stripe & cash on delivery payment method. He wants to build an eCommerce app so fast with less money & time so that he wants to know whether this business idea is going to work or not.

Note that resources are limited Time, Money, Quality. If you focus on quality you need more money and time. If you want to finish in less time with less money, the quality will be less.

After 1 month of hard-working eCommerce, the app was ready where people could buy listed products with limited payment gateway for a single country. The developer has made an application keeping in mind that the site will only handle 1000 users per second or less than 1000 users since the owner wanted to build his MVP so fast. Now the eCommerce seems booming, each and every people are loving this idea and using in their daily life. Now more people using means more traffic means your limited computing resource has to serve many people now. As this business is booming now the owner wants to build further, he wants to make it global with a variety of payment gateways, shipping, inventory management to work on. As the traffic starts to increases-:

  1. The site seems extremely slow people had to wait for more time to choose products.

Now he wants his tech team to solve these problems and tech team has one thing in mind, an idea of restructuring them into microservices (Product listing service, payment service, order processing service, inventory management service, Automation testing service, etc) and after they have successfully implemented microservices

  1. Scaling site was easy for them they could rewrite site into the latest stack.

Like everything comes off with tradeoff surely microservice is no different it has its own tradeoffs like the specialized team to handle multiple services, hard to trace / monitor, hard to maintain consistency, etc which I will describe in a future post. So decide which one will you really need. Happy Coding!

--

--

Software Development Enthusiast

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store