$npx -y skills add wshobson/agents --skill microservices-patternsDesign microservices architectures with service boundaries, event-driven communication, and resilience patterns. Use when building distributed systems, decomposing monoliths, or implementing microservices.
| 1 | # Microservices Patterns |
| 2 | |
| 3 | Master microservices architecture patterns including service boundaries, inter-service communication, data management, and resilience patterns for building distributed systems. |
| 4 | |
| 5 | ## When to Use This Skill |
| 6 | |
| 7 | - Decomposing monoliths into microservices |
| 8 | - Designing service boundaries and contracts |
| 9 | - Implementing inter-service communication |
| 10 | - Managing distributed data and transactions |
| 11 | - Building resilient distributed systems |
| 12 | - Implementing service discovery and load balancing |
| 13 | - Designing event-driven architectures |
| 14 | |
| 15 | ## Core Concepts |
| 16 | |
| 17 | ### 1. Service Decomposition Strategies |
| 18 | |
| 19 | **By Business Capability** |
| 20 | |
| 21 | - Organize services around business functions |
| 22 | - Each service owns its domain |
| 23 | - Example: OrderService, PaymentService, InventoryService |
| 24 | |
| 25 | **By Subdomain (DDD)** |
| 26 | |
| 27 | - Core domain, supporting subdomains |
| 28 | - Bounded contexts map to services |
| 29 | - Clear ownership and responsibility |
| 30 | |
| 31 | **Strangler Fig Pattern** |
| 32 | |
| 33 | - Gradually extract from monolith |
| 34 | - New functionality as microservices |
| 35 | - Proxy routes to old/new systems |
| 36 | |
| 37 | ### 2. Communication Patterns |
| 38 | |
| 39 | **Synchronous (Request/Response)** |
| 40 | |
| 41 | - REST APIs |
| 42 | - gRPC |
| 43 | - GraphQL |
| 44 | |
| 45 | **Asynchronous (Events/Messages)** |
| 46 | |
| 47 | - Event streaming (Kafka) |
| 48 | - Message queues (RabbitMQ, SQS) |
| 49 | - Pub/Sub patterns |
| 50 | |
| 51 | ### 3. Data Management |
| 52 | |
| 53 | **Database Per Service** |
| 54 | |
| 55 | - Each service owns its data |
| 56 | - No shared databases |
| 57 | - Loose coupling |
| 58 | |
| 59 | **Saga Pattern** |
| 60 | |
| 61 | - Distributed transactions |
| 62 | - Compensating actions |
| 63 | - Eventual consistency |
| 64 | |
| 65 | ### 4. Resilience Patterns |
| 66 | |
| 67 | **Circuit Breaker** |
| 68 | |
| 69 | - Fail fast on repeated errors |
| 70 | - Prevent cascade failures |
| 71 | |
| 72 | **Retry with Backoff** |
| 73 | |
| 74 | - Transient fault handling |
| 75 | - Exponential backoff |
| 76 | |
| 77 | **Bulkhead** |
| 78 | |
| 79 | - Isolate resources |
| 80 | - Limit impact of failures |
| 81 | |
| 82 | ## Detailed patterns and worked examples |
| 83 | |
| 84 | Detailed pattern documentation lives in `references/details.md`. Read that file when the navigation tier above is insufficient. |