This slide deck compares the two popular styles of software architecture - Monolith and Microservices based architecture. This presentation will help you decide which one works better for you, and when to use which architecture.
2. What is a monolithic architecture
➔ One “executable” that encapsulates the entire application functionality
➔ Tight coupling between the various components
➔ Single codebase and single unified runtime environment
➔ Eg: a web-based application which has the UI, Business Logic and Data
Access layers running as a single unit
3. What is a microservices architecture
➔ Application functionality is broken into smaller independent components
➔ Components are built and deployed separately
➔ Loose coupling between the various components
➔ Components communicate with each other via APIs, queues etc
➔ Multiple codebases each with their separate and entirely different runtime
environment
➔ Eg: an eCommerce application where the frontend and the various business
logic components (Catalog, Order, Payment, Shipping) run in separate silos
4. A Simple Example
Process A : Takes in data
from an external API
Process B : Transforms
data and stores in a
database
Process C : Sends
transformed data to
another API
Process A
Monolithic Architecture
Process B Process C
Process A
Microservices Architecture
Process B Process C
Database
Database
5. Advantages of Micro over Mono
➔ Better code organization and modularity based on functionality
➔ Better agility in terms of development, testing and deployment
➔ Enables autonomous and cross functional teams
➔ Components can be scaled up/down independently and as needed
➔ Enables usage of right tech stacks and infra as per needs of component
➔ Avoids problem of single point of failure
6. Advantages of Mono over Micro
➔ Often simpler to build, test and deploy
➔ Offers quicker release to market with core functionality
➔ Avoids complex integration testing between components
➔ Typically more secure due to lesser external exposure
➔ Less risk of miscommunication between systems, because of tight coupling
➔ Performance is typically better
7. When to choose which architecture
(As always, it depends!)
Choose Monolithic if the following is more
important to your use case :
- Quicker release to market
- High speed and performance
- Smaller and well-structured application
- Limited exposure to external endpoints
Choose Microservices if the following is more
important to your use case :
- Scalability is a big factor
- Better failure isolation
- Flexibility in adopting newer tech stacks
- Huge application with touchpoints to
several external resources