P1: What is MicroService?

P1: What is MicroService?
Photo by Jiayou Sun / Unsplash

Microservices are a new way of developing applications that are built around small services. They are also known as service-oriented architecture (SOA) or distributed systems.

Microservices are a software development approach where each application has its own discrete functionality. This means that they are independent of other microservices and can be developed separately.

Microservices are becoming increasingly popular because of their ability to improve the quality of the software and reduce costs. In this article, we’ll take a look at why microservices are important and how they can be used to develop better applications.

Let's understand, Monolith Applications

Monolith means single. When referring to software design. It refers to a single application or service that is built from scratch and then deployed into production. Monolithic architectures are often associated with legacy systems and large applications. They are relatively slow, inflexible, and expensive to develop, test, and deploy.

Basic Monolith Server Architecture - Fig 1

Now, what is MicroService?

In contrast, microservices are smaller components that are easier to build, test, and deploy individually. Microservices are also known as SOA (Service Oriented Architecture). Microservices are distributed services that communicate via APIs or any other communication channel. They are designed to be independent and loosely coupled. This makes them easier to scale and manage.

Basic MicroService Architecture - Fig 2

Why do we even need MicroService?

Microservices are widely taught today but you might wonder why it is essential for every modern system to use a microservices architecture instead of the monolith approach, i.e., services inside a single application.

It is generally said that there is a transition from old software engineering patterns based on the development of applications through an iteration loop:

  1. Requirement gathering
  2. Design
  3. Implementation
  4. Testing
  5. Deployment

Let's say that you have developed a website where users submit requests and each request should be processed by a specific server. In this example, if you continue with current programming practices you would require one big code base to deal with all functionalities. Of course, having a big single solution is easier to manage (just one version control), but it can create problems from time to time (i.e., performance).

Therefore, it is crucial to split responsibilities in order to address scalability issues. The idea behind microservices is that instead of developing different subsystems or servers side by side, they tend to operate together within the same context. In other words, developers can only focus on a piece of code without knowing the whole functionality. This modular approach has proven effective in many other domains of our lives - automotive, banking, insurance, etc.

In the next part we will understand the needs of MicroServices in depth.