Microservices : From Idea to Implementation

Ashwani Singh
4 min readNov 30, 2022

Introduction

Microservice architecture, are a specific method of designing software systems to structure a single application as a collection of loosely coupled services.

Applications tend to begin as a monolithic architecture (more on that below), and over time grow into a set of interconnected microservices.

The main idea behind microservices is that some types of applications are easier to build and maintain when they are broken down into many small pieces that work together.

Though the architecture has increased complexity, microservices still offer many advantages over the monolithic structure.

Microservices: High-Level Brief

Microservices is an architecture in which different component pieces of a software design are created and housed as individual, isolated services. Each is deployed separately and they communicate through well-defined network-based interfaces. Microservices are intended to be “small” (loosely defined) and kept to a single bounded context.

There are many benefits to microservices. Because of their isolation and strict requirement to communicate through well-defined interfaces, microservices prevent quick and dirty solutions often found in monoliths. These hacks inside of a monolith result in a loss of cohesion and an increase in coupling — two primary causes of complexity.

The downside for microservices is that to achieve these benefits, you must provide an underlying infrastructure which supports them. Without that support, you can easily find yourself with an unreliable and opaque system — or you find yourself reinventing the reliability wheel in every single service.

Microservices: High-Level Requirements Brief

An environment which supports microservices fundamentally needs a set of baseline requirements to ensure some level of sanity. If you are going to run microservices, your organization must be willing to bear the overhead of starting and supporting them. The overhead will not be insignificant. It will take time and money to do microservices well.

A successful microservices architecture must have an internal committee or group responsible for defining the macro-architecture this will define what infrastructure will be provided for the development and operation of microservices along with policies which all microservices must adhere. This committee must be the strongest of your development staff, and it may even be one or more people who do not even work for you yet.

How microservices works

Microservices are a set of services that act together to make a whole application operate.

This architecture utilizes API’s to pass information, such as user queries from one service to another.

This makes both communicating between teams and upgrading services very dynamic — even reactive — allowing a software company or team to be more resilient in its development.

In the case of microservices, the user’s machine may be responsible for basic processing, but it is mostly responsible for sending and receiving network calls to other computers.

Whenever you use an application, it’s reasonable to assume that there are five other computers, give or take, that just turned on in order to power your experience. In the case of something like Facebook or Uber, it may be more reasonable to expect another 10,000 computers are actively processing information to enhance the user experience.

Microservices are often considered a logical evolution of Service Oriented Architecture (SOA), but there are clear differences between the two.

Monolithic architecture vs Microservice architecture

In a monolithic architecture, the software is a single application distributed

Characteristics of a monolithic architecture:

  • Changes are slow
  • Changes are costly
  • Hard to adapt to a specific, or changing, product line

Monolithic structures make changes to the application extremely slow. Modifying just a small section of code can require a completely rebuilt and deployed version of software.

(Learn about the complexities of app modernization and code refactoring.)

If developers wish to scale certain functions of an application, they must scale the entire application, further complicating changes and updates. Microservices help to solve these challenges.

Advantages to Microservices

Applications built as a set of independent, modular components are easier to test, maintain, and understand. They enable organizations to:

  • Increase agility
  • Improve workflows
  • Decrease the amount of time it takes to improve production

While each independent component increases complexity, the component can also have added monitoring capabilities to combat it.

Here are the most common pros of microservices, and why so many enterprises already use them.

Developer independence

Small teams that are working in parallel can iterate faster than larger teams. When a single service takes off in popularity, the smaller team can also scale the services on their own without having to wait for a larger and more complex team.

Isolation & resilience

If one of the components should fail, developers are able to spin up another component while the rest of the application continues to function independently.

This capability gives developers the freedom to develop and deploy services as needed, without having to wait on decisions concerning the entire application.

Scalability

Because microservices are made of much smaller components, they can take up fewer resources and therefore more easily scale to meet increasing demand of that specific component.

As a result of their isolation, microservices can properly function even during large changes in size and volume, making it ideal for enterprises dealing with a wide range of platforms and devices.

Autonomously developed

Its autonomous nature benefits teams because it:

  • Enables scaling and development
  • Doesn’t require much coordination with other teams

Microservices are a particular advantage when companies become more distributed and workers more remote.

Examples of the big folks who adopted Microservice Architechture to reduce the issues they are facing in Monolithic Pattern

  • eBay
  • Amazon
  • Twitter
  • PayPal
  • SoundCloud
  • Gilt

--

--