Monolith vs microservice architecture

Contents and images taken from the book: https://www.amazon.com/Microservices-Patterns-examples-Chris-Richardson/dp/1617294543

Monolithic architecture

Benefits

  • Simple to develop: IDEs and other developer tools are focoused on building a single applicatoin
  • Easy to make radical changes to the applicatoin: You can change the code and the database schema, build, and deploy
  • Straightforward to test: The developers wrote end-to-end tests that launched the application, invoked REST API
  • Straightforward to deploy
  • Easy to scale: Ran multiple instances of the application behind a load balancer

Drawbacks

  • Development is slow: the large applicatoin overloads and slow down a developer's IDE. The application takes a long time to start up
  • Path from commit to deployment is long: Adopting continuous deployment seems impossible
  • Locked into obsolete techonology stack

Microservices

X-axis scale

Z-axis scale

Y-axis scale

Scaling functionally by decomposing an application into services

Each service has its own database

  • They are loosely coupled and communicate only via APIs.

Benefits

  • It enables the continuous delivery and deployment of large, complex applications:
    • Reduces the time to market, which enables the business to rapidly react to feedback from customers.
    • Employee satisfaction is higher because more time is spent delivering valuable features instead of fighting fires.
  • Services are small and easily maintained.
  • Services are independently deployable and scalable
  • The microservice architecture enables teams to be autonomous.
  • It allows easy experimenting and adoption of new technologies.
  • It has better fault isolation

Drawbacks

  • Finding the right set of services is challenging.
  • Distributed systems are complex, which makes development, testing, and deploy- ment difficult.
  • Deploying features that span multiple services requires careful coordination

Last updated on