Monolithic vs Microservices

What is Monolithic?



What is SOA?



What is Microservices?



Advantages of Microservices

Feature Monolithic Architecture SOA (Service-Oriented Architecture) Microservices Architecture
Architecture Style Single, unified codebase for the entire application. Decoupled services, typically using an Enterprise Service Bus (ESB) for communication. Independent, small services that communicate via lightweight protocols like HTTP/REST.
Size and Complexity Large, tightly coupled application. Modular but often larger services compared to microservices. Fine-grained, small, loosely coupled services.
Communication Internal method calls within the same process. Typically uses ESB for messaging and service coordination. Communicates via lightweight mechanisms such as REST or messaging queues.
Deployment Entire application must be redeployed for changes. Individual services can be deployed independently, but ESB may require coordination. Independent services can be deployed and scaled independently.
Scalability Limited scalability; scaling involves duplicating the whole application. Scalable, but can be bottlenecked by ESB. Highly scalable; individual services can be scaled based on demand.
Maintenance Harder to maintain; any change may affect the entire application. Easier to maintain due to modularity but complexity in ESB management. Easier to maintain as services are smaller and focused on specific tasks.
Fault Isolation Failure in one part can bring down the entire system. Better fault isolation but complex ESB can affect recovery. Failures are isolated to specific services; the rest of the system remains unaffected.
Data Management Centralized database shared by the entire application. Shared databases but with some service-specific schemas. Each service manages its own database, promoting data isolation.
Performance Faster within a single process, but can become slow as the application grows. Slower due to ESB overhead and service orchestration. Can be slower due to network communication, but scales well under load.
Pros Simple to develop and deploy in small applications. Modular services, better reusability, flexibility with ESB integration. Highly scalable, fault-tolerant, technology agnostic, and easy to maintain.
Cons Difficult to scale, maintain, and deploy in large systems; tightly coupled components. ESB can become a bottleneck; increased complexity in managing service dependencies. More complex to develop due to distributed nature; requires good management of service communication and data consistency.


Frameworks to Develop Microservices

  1. Spring Boot (Java)
  2. Micronaut (Java)
  3. Quarkus (Java)
  4. DropWizard (Java)
  5. Flask (Python)
  6. Django (Python)
  7. Go Micro (Golang)
  8. Node.js with Express.js
  9. Lagom (Scala)

Why spring boot for microservices?