Microservices vs. Monolithic Architecture
This post is a term explanation for the architecture comparison Microservices vs. Monolith – including exam questions, core elements, and tags.
In a Nutshell
Microservices and monolithic architecture are two opposing approaches to software structure: modular/decentralized/scalable vs. centralized/simple/consistent.
Compact Technical Description
Monolithic architecture describes software that is deployed and operated as a single unit. Functions, logic, and interfaces are tightly coupled.
Microservices architecture breaks down the application into many small, independent services that communicate via network interfaces (usually REST or messaging). Each service can be developed, tested, and deployed independently – often with its own data storage.
Microservices offer advantages in scalability and maintainability, but require more infrastructure, DevOps expertise, and clean interfaces.
Exam-Relevant Key Points
- Monolith = one application, one deployment
- Microservices = independent services (often separate repositories)
- Microservices promote scalability and flexibility (IHK-relevant)
- Monolith is simpler for small projects (practical relevance)
- Microservices require API gateways, authentication, logging (security aspect)
- Infrastructure overhead for microservices is higher (cost-effectiveness)
- Interfaces and dependencies must be documented (documentation requirement)
- Microservices work well for CI/CD and agile teams
Core Components
- Service boundaries and bounded context
- Communication (REST, gRPC, messaging)
- Database per service (microservices)
- Central database (monolith)
- Deployment strategy (single vs. multiple pipelines)
- Service registry & discovery
- Monitoring/logging per service
- Security layer and authentication
- Error isolation (circuit breaker, retry, fallback)
- Service documentation (OpenAPI)
Simple Practical Example
Monolith:
A web shop is a Java Spring Boot project with modules (User, Orders, Inventory) → one deployment.
Microservices:
User Service, Order Service, Inventory Service are independent services, communicate via REST,
are deployed separately via Docker/Kubernetes.
Advantages and Disadvantages
Monolith
- Advantages: simple deployment, lower infrastructure requirements, less complexity for small teams
- Disadvantages: difficult to scale, changes affect other modules, longer release cycles
Microservices
- Advantages: independent teams, scaling per service, technology diversity
- Disadvantages: high DevOps effort, complex interfaces, distributed transactions more difficult
Typical Exam Questions (with Short Answer)
- What is a monolith? An application that runs and is deployed as a single unit.
- Two advantages of microservices? Scaling of individual services, independent deployment.
- When is a monolith sensible? For small projects with few stakeholders.
- How do microservices typically communicate? Via HTTP/REST, gRPC, or messaging (Kafka/RabbitMQ).
- Why is microservices architecture more complex? Distributed system, multiple deployments, more sources of error.
- What is an API gateway? Central entry point to services (routing, auth, monitoring).
Glossary
| Term | Definition |
|---|---|
| Monolithic architecture | centralized software structure in one codebase |
| Microservices architecture | distributed architecture with autonomous services |
| API gateway | centralized control of access to microservices |
Free Response
For many IHK exam projects, a monolith is often better documentable and sufficient. Microservices are worthwhile only when clear boundaries, infrastructure, and DevOps capabilities are present. A good compromise is a modular monolith.
Learning Strategy
- Understanding entry: Sketch both architectures for the same use case.
- Deepening: Build a mini-system with Docker Compose.
- Exam focus: Justify your architecture choice in writing.
- Avoiding errors: Do not automatically assume “microservices = better.”
Topic Analysis
- Technical core: Service orientation, interfaces, deployments
- Implementation: Communication, data consistency, CI/CD
- Security: Service boundaries, auth, gateways
- Documentation: Interfaces/dependencies/deployments
- Cost-effectiveness: Effort vs. flexibility
Further Information
- https://martinfowler.com/articles/microservices.html
- https://www.ibm.com/cloud/learn/monoliths-vs-microservices
- https://learn.microsoft.com/en-us/azure/architecture/guide/architecture-styles/microservices