Microservices Design Patterns Roadmap
41 sections • 482 topics
- 1. Understanding Microservices Architecture
- High-Level Architecture
- 2. Understanding Microservices Characteristics
- 3. Understanding Service Boundaries
- Example: E-commerce Service Boundaries
- 4. Understanding Service Independence
- 5. Understanding Single Responsibility Principle
- 6. Understanding Microservices vs Monolith
- 7. Understanding Distributed Systems Challenges
- 8. Understanding Service Granularity
- 9. Understanding Service Ownership
- "You Build It, You Run It"
- 10. Understanding Conway's Law
- 1. Understanding Synchronous Communication
- Example: Synchronous REST Call (Java + Spring)
- 2. Understanding Asynchronous Communication
- Example: Async Publishing (Java + Kafka)
- 3. Understanding Communication Protocols
- 4. Synchronous vs Asynchronous Communication
- Synchronous
- Asynchronous
- 5. Understanding Message Brokers
- 6. Understanding RPC Patterns
- Example: gRPC Service (Protobuf)
- 7. Understanding Event-Driven Architecture
- Event Flow
- 8. Understanding Pub/Sub Model
- 9. Understanding Request/Reply Model
- Example: Async Request/Reply with Correlation ID
- 10. Understanding Push vs Pull Communication
- 1. Decompose by Business Capability
- Example: Capability Map → Services
- 2. Decompose by Subdomain
- 3. Decompose by Use Case
- 4. Decompose by Volatility
- 5. Self-Contained Service Pattern
- 6. Service per Team Pattern
- 7. Strangler Fig Pattern
- Strangler Migration
- 8. Anti-Corruption Layer Pattern
- Example: ACL Wrapping Legacy SOAP
- 9. Separate Front and Backend Services
- 10. Understanding Decomposition Trade-offs
- 1. Bounded Context Pattern
- Example: Same Concept, Different Contexts
- 2. Aggregate Pattern
- Example: Order Aggregate (Java)
- 3. Entity Pattern
- 4. Value Object Pattern
- Example: Money Value Object (Java 21+ record)
- 5. Repository Pattern
- Example: Repository Interface
- 6. Domain Event Pattern
- Example: Domain Event
- 7. Domain Service Pattern
- 8. Factory Pattern
- Example: Order Factory
- 9. Specification Pattern
- Example: Specification
- 10. Ubiquitous Language Pattern
- 11. Context Mapping Pattern
- 1. Request/Response Pattern
- 2. Asynchronous Messaging Pattern
- 3. Publish/Subscribe Pattern
- 4. Point-to-Point Messaging Pattern
- 5. Remote Procedure Invocation Pattern
- 6. Domain-Specific Protocol Pattern
- 7. Transactional Outbox Pattern
- Example: Outbox Table + Atomic Write
- 8. Polling Publisher Pattern
- 9. Transaction Log Tailing Pattern
- 10. Competing Consumers Pattern
- Competing Consumers
- 1. Event Notification Pattern
- Example: Notification Event
- 2. Event-Carried State Transfer Pattern
- 3. Event Sourcing Pattern
- Example: Rebuild State from Events
- 4. Event Collaboration Pattern
- 5. Event Store Pattern
- 6. Event Replay Pattern
- 7. Event Ordering Pattern
- 8. Event Deduplication Pattern
- 9. Event Streaming Pattern
- Example: Kafka Streams Aggregation
- 10. Event-Driven State Machine Pattern
- 1. Event Schema Evolution Pattern
- 2. Event Versioning Pattern
- 3. Schema Registry Pattern
- 4. Tolerant Reader Pattern
- Example: Jackson Tolerant Reader
- 5. Expand and Contract Pattern
- 6. Upcaster Pattern
- Example: Upcaster
- 7. Event Wrapper Pattern
- 8. Canonical Data Model Pattern
- 9. Event Envelope Pattern
- Example: CloudEvents Envelope
- 10. Schema Validation Pattern
- 1. At-Least-Once Delivery Pattern
- 2. At-Most-Once Delivery Pattern
- 3. Exactly-Once Delivery Pattern
- 4. Idempotent Consumer Pattern
- Example: Idempotent Insert
- 5. Message Acknowledgment Pattern
- 6. Dead Letter Queue Pattern
- Example: RabbitMQ DLX Configuration
- 7. Poison Message Handling Pattern
- 8. Message Deduplication Pattern
- 9. Inbox Pattern
- Example: Inbox Atomic Processing
- 10. Priority Queue Pattern
- 1. Database per Service Pattern
- 2. Shared Database Anti-Pattern
- 3. Polyglot Persistence Pattern
- 4. CQRS Pattern
- 5. Materialized View Pattern
- Example: Customer Order Summary View
- 6. Data Replication Pattern
- 7. Transaction Log Tailing Pattern
- 8. Change Data Capture Pattern
- 9. Data Mesh Pattern
- 10. Data Lake Pattern
- 1. Strong Consistency Pattern
- 2. Eventual Consistency Pattern
- 3. Causal Consistency Pattern
- 4. Read-Your-Writes Consistency Pattern
- 5. Monotonic Reads Pattern
- 6. Monotonic Writes Pattern
- 7. Optimistic Locking Pattern
- Example: Optimistic UPDATE
- 8. Pessimistic Locking Pattern
- 9. Conflict-Free Replicated Data Type Pattern
- 10. Version Vector Pattern
- 1. Command Model Pattern
- Example: Command + Handler
- 2. Query Model Pattern
- 3. Read Models Pattern
- 4. Event Sourcing with CQRS
- ES + CQRS Flow
- 5. Separate Read/Write Databases
- 6. Projection Pattern
- 7. Snapshot Pattern
- 8. Command Handler Pattern
- 9. Query Handler Pattern
- Example: Query Handler
- 10. Eventually Consistent Queries
- 1. Saga Orchestration Pattern
- Example: Order Saga Orchestrator (Temporal-style)
- 2. Saga Choreography Pattern
- Choreography Flow
- 3. Implementing Compensating Transactions
- 4. Managing Saga State Machines
- 5. Handling Saga Failures
- 6. Saga Timeout Pattern
- 7. Saga Recovery Pattern
- 8. Saga Isolation Pattern
- 9. Saga Logging Pattern
- 10. Saga Compensation Order Pattern
- 1. Two-Phase Commit Pattern
- 2. Three-Phase Commit Pattern
- 3. Try-Confirm-Cancel Pattern
- Example: TCC Inventory
- 4. Reservation Pattern
- 5. Saga Pattern vs 2PC
- 2PC (XA)
- Saga
- 6. Compensating Transaction Pattern
- 7. Outbox Pattern
- 8. Transaction Coordinator Pattern
- 9. Distributed Lock Pattern
- Example: Redis Lock
- 10. Fencing Token Pattern
- Fencing Token Flow
- 1. API Gateway Pattern
- 2. Backends for Frontends Pattern
- BFF Topology
- 3. Gateway Routing Pattern
- 4. Gateway Aggregation Pattern
- Example: Aggregated Order Detail
- 5. Gateway Offloading Pattern
- 6. Micro Gateway Pattern
- 7. GraphQL Gateway Pattern
- 8. API Gateway with Circuit Breaker
- 9. Edge Service Pattern
- 10. Gateway Rate Limiting Pattern
- 1. Client-Side Discovery Pattern
- 2. Server-Side Discovery Pattern
- 3. Service Registry Pattern
- 4. Self-Registration Pattern
- 5. Third-Party Registration Pattern
- 6. Health Check Pattern
- Example: Spring Boot Actuator
- 7. DNS-Based Discovery Pattern
- 8. Service Metadata Pattern
- 9. Lease Pattern
- 10. Heartbeat Pattern
- 1. API Composition Pattern
- 2. Aggregator Service Pattern
- 3. Composite Service Pattern
- 4. Response Aggregation Pattern
- Example: Partial Response
- 5. Parallel Service Call Pattern
- 6. Sequential Service Call Pattern
- 7. Scatter-Gather Pattern
- 8. Partial Response Pattern
- 9. Data Joining Pattern
- 10. Content Enricher Pattern
- 1. Orchestration Pattern
- 2. Process Manager Pattern
- 3. Routing Slip Pattern
- 4. Centralized Workflow Pattern
- 5. Workflow State Machine Pattern
- 6. Compensation Workflow Pattern
- 7. Long-Running Transaction Pattern
- Example: Temporal Workflow
- 8. Pipeline Pattern
- 9. Orchestration Engine Pattern
- 10. Process Choreography Pattern
- 1. Leader Election Pattern
- Example: K8s Lease Election
- 2. Distributed Lock Pattern
- 3. Distributed Consensus Pattern
- 4. Coordination Service Pattern
- 5. Work Distribution Pattern
- 6. Task Queue Pattern
- 7. Claim Check Pattern
- Example: Claim Check with S3
- 8. Distributed Barrier Pattern
- 9. Distributed Latch Pattern
- 10. Scheduling Coordinator Pattern
- 1. Circuit Breaker Pattern
- 2. Circuit Breaker States
- State Machine
- 3. Circuit Breaker Fallback Pattern
- 4. Circuit Breaker Threshold Configuration
- Example: Resilience4j Config
- 5. Circuit Breaker with Timeout
- 6. Hierarchical Circuit Breaker Pattern
- 7. Circuit Breaker Metrics Pattern
- 8. Circuit Breaker Recovery Pattern
- 9. Per-Host Circuit Breaker Pattern
- 10. Adaptive Circuit Breaker Pattern
- 1. Request Timeout Pattern
- 2. Connection Timeout Pattern
- 3. Deadline Propagation Pattern
- Example: gRPC Deadline (Go)
- 4. Cascading Timeout Pattern
- 5. Adaptive Timeout Pattern
- 6. Long-Running Operation Pattern
- Example: Long-Running Operation Response
- 7. Timeout Recovery Pattern
- 8. Timeout Budget Pattern
- 9. Asynchronous Timeout Pattern
- 10. Deadline Context Pattern
- 1. Rate Limiting Pattern
- 2. Token Bucket Pattern
- 3. Leaky Bucket Pattern
- 4. Sliding Window Pattern
- 5. Fixed Window Pattern
- 6. Adaptive Rate Limiting Pattern
- 7. Distributed Rate Limiting Pattern
- Example: Redis Token Bucket (Lua)
- 8. Client-Based Rate Limiting
- 9. API Quota Pattern
- 10. Rate Limit Response Pattern
- 1. Cache-Aside Pattern
- Example: Cache-Aside (Java + Redis)
- 2. Read-Through Cache Pattern
- 3. Write-Through Cache Pattern
- 4. Write-Behind Cache Pattern
- 5. Refresh-Ahead Cache Pattern
- 6. Distributed Cache Pattern
- 7. Near Cache Pattern
- 8. Cache Invalidation Pattern
- 9. Cache Stampede Prevention Pattern
- 10. Multi-Level Cache Pattern
- 1. Process Isolation Pattern
- 2. Resource Isolation Pattern
- 3. Namespace Isolation Pattern
- 4. Network Isolation Pattern
- Example: K8s NetworkPolicy
- 5. Security Context Isolation Pattern
- 6. Fault Isolation Pattern
- 7. Deployment Isolation Pattern
- 8. Data Isolation Pattern
- 9. Tenant Isolation Pattern
- 10. Runtime Isolation Pattern
- 1. Asynchronous Communication Pattern
- 2. Response Compression Pattern
- 3. Connection Pooling Pattern
- 4. Request Batching Pattern
- Example: GraphQL DataLoader
- 5. Lazy Loading Pattern
- 6. Prefetching Pattern
- 7. Resource Pooling Pattern
- 8. Denormalization Pattern
- 9. Index Optimization Pattern
- 10. Parallel Processing Pattern
- 1. Service-to-Service Authentication Pattern
- 2. Token-Based Authentication Pattern
- Example: JWT Bearer
- 3. OAuth2 Pattern
- 4. API Key Pattern
- 5. Mutual TLS Pattern
- 6. Zero Trust Security Pattern
- 7. Defense in Depth Pattern
- 8. Role-Based Access Control Pattern
- 9. Attribute-Based Access Control Pattern
- Example: OPA Rego Policy
- 10. Secrets Management Pattern
- 1. Service Mesh Pattern
- 2. Sidecar Proxy Pattern
- 3. Control Plane Pattern
- 4. Data Plane Pattern
- 5. Service Mesh Security Pattern
- 6. Traffic Management Pattern
- Example: Istio VirtualService Canary
- 7. Service Mesh Observability
- 8. Circuit Breaking in Service Mesh
- 9. Service Mesh Retry and Timeout
- 10. Canary Traffic Routing
- 1. Distributed Tracing Pattern
- Example: OTel Java Auto-Instrumentation
- 2. Correlation ID Pattern
- 3. Log Aggregation Pattern
- 4. Application Metrics Pattern
- 5. Health Check API Pattern
- Example: Health Response
- 6. Exception Tracking Pattern
- 7. Audit Logging Pattern
- 8. Distributed Context Propagation Pattern
- 9. Service Dependency Mapping Pattern
- 10. Span Context Pattern
- 1. Externalized Configuration Pattern
- 2. Configuration Server Pattern
- 3. Service Template Pattern
- 4. Configuration Versioning Pattern
- 5. Feature Toggle Pattern
- Example: Feature Flag Use
- 6. Dynamic Configuration Pattern
- 7. Environment-Specific Configuration Pattern
- 8. Secrets Configuration Pattern
- 9. Configuration Inheritance Pattern
- 10. Configuration Validation Pattern
- 1. API Versioning Pattern
- 2. URL Path Versioning Pattern
- 3. Header Versioning Pattern
- 4. Query Parameter Versioning Pattern
- 5. Content Negotiation Versioning Pattern
- 6. Semantic Versioning Pattern
- 7. Backward Compatibility Pattern
- 8. Forward Compatibility Pattern
- 9. Deprecation Pattern
- Example: Deprecation Headers
- 10. Parallel Versions Pattern
- 1. Database per Tenant Pattern
- 2. Schema per Tenant Pattern
- 3. Shared Database Discriminator Pattern
- Example: Postgres RLS
- 4. Tenant Isolation Pattern
- 5. Tenant Context Propagation Pattern
- 6. Tenant-Based Routing Pattern
- 7. Tenant Configuration Pattern
- 8. Per-Tenant Resource Quota Pattern
- 9. Tenant-Based Caching Pattern
- 10. Tenant Onboarding Pattern
- 1. Blue-Green Deployment Pattern
- 2. Canary Deployment Pattern
- 3. Rolling Deployment Pattern
- 4. A/B Testing Pattern
- 5. Shadow Deployment Pattern
- 6. Feature Toggle Deployment Pattern
- 7. Immutable Infrastructure Pattern
- 8. Zero-Downtime Deployment Pattern
- 9. Parallel Run Pattern
- 10. Progressive Delivery Pattern
- 1. Consumer-Driven Contract Testing Pattern
- 2. Service Component Test Pattern
- 3. Integration Contract Test Pattern
- 4. End-to-End Test Pattern
- 5. Service Virtualization Pattern
- 6. Test Double Pattern
- 7. Chaos Engineering Pattern
- 8. Canary Testing Pattern
- 9. Shadow Testing Pattern
- 10. Synthetic Transaction Pattern
- 1. Avoiding Distributed Monolith Anti-Pattern
- 2. Avoiding Shared Database Anti-Pattern
- 3. Avoiding Chatty Services Anti-Pattern
- 4. Avoiding God Service Anti-Pattern
- 5. Avoiding Nanoservice Anti-Pattern
- 6. Avoiding Spaghetti Architecture Anti-Pattern
- 7. Avoiding Wrong Cuts Anti-Pattern
- 8. Avoiding Synchronous Chains Anti-Pattern
- 9. Avoiding Mega Service Anti-Pattern
- 10. Avoiding Shared Library Overuse Anti-Pattern