Defining Microservices
You'll learn what microservices are and how they differ from the modular monolith you just studied.
What Are Microservices?
Microservices are small, independently deployable services organized around specific business capabilities. Unlike a modular monolith where modules live in a single deployable unit, each microservice is its own separate process with its own runtime, database, and deployment lifecycle.
Think of it like moving from a single multi-department office building (monolith) to separate office locations for each department. Each location operates independently—sales has its own building, accounting has its own, and they communicate through structured channels (APIs) rather than walking down the hall.
Key Characteristics
Business Capability Focus: Each microservice owns a complete business function (e.g., "Order Processing," "User Authentication," "Inventory Management"), not just technical layers.
Independent Deployment: You can update, deploy, and scale one service without touching others. This is the fundamental difference from modular monoliths where modules deploy together.
Data Ownership: Each microservice typically manages its own database or data store. No shared database means no hidden coupling through data access.
Technology Independence: Different services can use different programming languages, frameworks, or storage technologies based on their specific needs.
The Trade-off
While microservices offer deployment independence and scaling flexibility, they introduce distributed system complexity: network calls, eventual consistency, debugging across processes, and orchestration challenges. This is why you start with a modular monolith (as you just learned) and evolve to microservices only when the benefits justify the complexity.
Key Takeaway: Microservices are independently deployable services organized around business capabilities, offering deployment flexibility at the cost of distributed system complexity.