Definition

Microservices are an architectural approach to building applications. A microservice architecture consists of independently deployable services organized around business capability. Multiple independent modules are individually responsible for performing precisely defined, standalone tasks. These modules communicate with each other through simple, universally accessible application programming interfaces (APIs). Each service is self-contained and implements a single business capability.

Microservices structures an application as a collection of services that are

  • Highly maintainable and testable
  • Loosely coupled
  • Independently deployable
  • Organized around business capabilities

Microservice vs Monolithic Architecture

Monolith Architecture has one code base with multiple modules. Microservice architecture breaks an application down into its core functions. Each function is called a service, built and deployed independently.

Microservices vs Monolithic Architecture
Microservices vs Monolithic Architecture

In Monolith Architecture, all the features are under a single instance sharing a single database. In Microservice architecture, each feature maps to a different microservice, handling their own data, and performing different functionalities.

Benefits

Some of the benefits from deploying microservices

  • Improved scalability : A service can be independently scaled up or down. Ease and cost of scaling is less than in a monolithic system.
  • Better fault isolation : If one microservice fails, all the others will likely continue to work.
  • Localized complexity : Owners of the service need to understand what is within their service, without having to worry about other serives. Compartmentalization of knowledge and complexity makes it easier to create and manage large applications.
  • Increased business agility : Failure of a microservice affects only that service, not the whole application. Microservices give freedom to experiment.
  • Future-proofed applications : Easier to respond to new technology by replacing or upgrading the individual services affected without impacting the whole application.
  • Smaller and more agile development teams
  • Simplified debugging and maintenance

Reference

Microservices