Why such a hype for microservices?

Prateek Nima
5 min readJun 5, 2020

You might have recently noticed the hype with the use of microservices over a wide range of applications. Majority of companies are switching to this architecture, every new job posting demands the knowledge of microservices. The increase in demand is easily evident in the graph below.

Microservices - Job vacancy trend (Picture Credits:- www.itjobswatch.co.uk)

Let us see how did this start. The high-level overview of transitions in development not only helps us to know how far have we come but also helps us to know the advantages and drawbacks of each one of them.

1. The era of old mainframe computers.

When we go back to the old days, the computers used to occupy the entire room. The computers made using tubes initially, which were then replaced by transistors assembled using large components were used. The instructor would go to the computer to give the instructions which were then executed by the system in the form of batches. The computers would take days to execute the instructions.

2. Traditional Application Development.

Traditional Application Development

With the innovation and utilization of personal computers, the code was now written in a single code base. But the major flaw was incrementing the functionality of the application would increase the complexity of the code and error solving immensely. Today, considering the complexity of huge applications one cannot think to use a single file for developing them.

3. Modular Application Development

Modular Application Development

As development using traditional approach became incredibly complex day by day, the code base was now divided into multiple files or modules based on its functionality. This not only helped to ease up the process but also made backtracking convenient in case of errors. Allocating tasks to the developers now became easy.

4. Web Application Development

Earlier the application used to be installed on the client machine from where the services could be accessed. Instead of that, the applications were now deployed on an application server. This made the application to be easily accessible, scalable along with the convenience of remote access.

5. Development using the Microservice Architecture.

The architectures used for application development has been evolved over the years. The type of architecture being used relies upon the design which is feasible for your application.

Software Architecture Designs

a) Monolithic Architecture

In a monolithic architecture, all the functionalities reside in one single code base. It comprises of multiple modules in one single file. Despite the fact that using monolithic architecture seems to be old school, thousands of applications have been made using the same. In fact, monolithic architecture is the best choice for a small organisation who is just been into development. To describe it in single line Monolithic architecture does not rely on files from any other server for its execution.

b) Service-Oriented Architecture(SOA)

Service-Oriented Architecture(SOA) was the first step in development which helped in separating different layers. Although, the coupling increases in such an architecture, it makes the project development much easy and facilitates the separation of layers.

c) Microservices Architecture

High-Level Overview of Microservices Architecture

The microservices architecture is more fine-grained version of SOA. Here each code base represents separate entities which provide some essential service. E.g. An eCommerce website will have multiple microservices such as the cart system, the billing system, the product catalogues, the wishlist feature and many more. This helps the development team to focus on their individual services, unaffected by other services. Microservices contact each other using Html requests usually in JSON format.

The following are the advantages of using the microservice architecture:

  1. Easy to develop and maintain the code. E.g., If a new developer joins your team and causes a flaw in your code only that particular service is affected while other services still work flawlessly.
  2. Easy to scale up individual service instead of the application as a whole. This becomes extremely important since cloud services estimate your billing based on the resources you use. E.g., If your catalogue service is facing high workloads it could be easily scaled horizontally while others are still working at the same capacity.
  3. Allows you to use multiple programming languages for the overall development of the code. Since microservices communicate with each other using JSON, it enables us to develop the overall application using multiple programming languages. E.g., A microservice developed using Java programming language can easily communicate to a microservice developed using Python programming language.
  4. A new developer in your team can easily understand the functionality of your code due to its simplicity.

There is a long list of advantages of using microservices but it comes with some disadvantages such as

  1. Communication between microservices might become complex sometimes.
  2. Each microservice will usually have its database, which might be painful to manage.
  3. Testing the microservice application as a whole is a bit cumbersome and many more.

As we can see microservice architecture has its own set of advantages which comes along with a set of drawbacks. Some of them consider using monolithic architecture as old school. But this does not stand true as you might use an architecture which is of best suits your application and organisation.

Below is an overview of the discussion to sum it up.

Hope this article helped you to learn something new and clear your doubts regarding the microservices. If you have any further doubts feel free to comment it below.

Hope you have a great day ahead!

--

--