microservices-patterns
wshobson/agents
Design distributed systems with service boundaries, event-driven communication, and resilience patterns.
What is microservices-patterns?
Microservices Patterns provides architecture guidance for building distributed systems, including service decomposition strategies, inter-service communication patterns, data management approaches, and resilience techniques. Use this when decomposing monoliths, designing service boundaries, or implementing event-driven architectures.
- Design service boundaries using business capability or domain-driven design approaches
- Implement synchronous communication via REST, gRPC, or GraphQL
- Implement asynchronous communication using event streaming and message queues
- Apply saga pattern for distributed transactions with eventual consistency
- Build resilience with circuit breaker, retry with backoff, and bulkhead patterns
- Gradually extract services from monoliths using the Strangler Fig pattern
How to install microservices-patterns
npx skills add https://github.com/wshobson/agents --skill microservices-patternsHow to use microservices-patterns
- 1.Identify your decomposition strategy: organize by business capability, subdomain, or use Strangler Fig for gradual extraction
- 2.Choose communication patterns: synchronous (REST/gRPC) for tight coupling needs, asynchronous (Kafka/RabbitMQ) for loose coupling
- 3.Implement database-per-service pattern with each service owning its data
- 4.Apply resilience patterns: circuit breaker for fault isolation, retry with backoff for transient failures, bulkhead for resource isolation
- 5.For distributed transactions, implement saga pattern with compensating actions for eventual consistency
- 6.Consult references/details.md for detailed pattern documentation and worked examples
Use cases
- Decomposing a monolithic application into independently deployable microservices
- Designing service contracts and boundaries for a new distributed system
- Implementing event-driven communication between order, payment, and inventory services
- Handling distributed transactions across multiple services using compensating actions
- Building fault tolerance to prevent cascade failures in a distributed system
- Backend architects designing distributed systems
- Teams decomposing monolithic applications
- Developers implementing inter-service communication
- Engineers building resilient, scalable platforms
microservices-patterns FAQ
Use synchronous (REST/gRPC) when you need immediate responses and tight coupling is acceptable. Use asynchronous (events/messages) for loose coupling, better resilience, and when eventual consistency is acceptable.
Use the saga pattern with compensating actions. Each service completes its local transaction, and if a step fails, compensating transactions undo previous steps to maintain consistency.
Each microservice owns its own database with no shared databases between services. This ensures loose coupling and allows each service to choose the best database technology for its needs.
Circuit breakers monitor service calls and fail fast when a threshold of errors is reached, preventing repeated calls to failing services and stopping failures from propagating through the system.
A gradual migration strategy where new functionality is built as microservices while a proxy routes requests to either the new services or the legacy monolith, allowing incremental decomposition.
Full instructions (SKILL.md)
Source of truth, from wshobson/agents.
name: microservices-patterns description: Design microservices architectures with service boundaries, event-driven communication, and resilience patterns. Use when building distributed systems, decomposing monoliths, or implementing microservices.
Microservices Patterns
Master microservices architecture patterns including service boundaries, inter-service communication, data management, and resilience patterns for building distributed systems.
When to Use This Skill
- Decomposing monoliths into microservices
- Designing service boundaries and contracts
- Implementing inter-service communication
- Managing distributed data and transactions
- Building resilient distributed systems
- Implementing service discovery and load balancing
- Designing event-driven architectures
Core Concepts
1. Service Decomposition Strategies
By Business Capability
- Organize services around business functions
- Each service owns its domain
- Example: OrderService, PaymentService, InventoryService
By Subdomain (DDD)
- Core domain, supporting subdomains
- Bounded contexts map to services
- Clear ownership and responsibility
Strangler Fig Pattern
- Gradually extract from monolith
- New functionality as microservices
- Proxy routes to old/new systems
2. Communication Patterns
Synchronous (Request/Response)
- REST APIs
- gRPC
- GraphQL
Asynchronous (Events/Messages)
- Event streaming (Kafka)
- Message queues (RabbitMQ, SQS)
- Pub/Sub patterns
3. Data Management
Database Per Service
- Each service owns its data
- No shared databases
- Loose coupling
Saga Pattern
- Distributed transactions
- Compensating actions
- Eventual consistency
4. Resilience Patterns
Circuit Breaker
- Fail fast on repeated errors
- Prevent cascade failures
Retry with Backoff
- Transient fault handling
- Exponential backoff
Bulkhead
- Isolate resources
- Limit impact of failures
Detailed patterns and worked examples
Detailed pattern documentation lives in references/details.md. Read that file when the navigation tier above is insufficient.
Related skills
More from wshobson/agents and the wider catalog.
tailwind-design-system
Build production-ready design systems with Tailwind CSS v4, design tokens, and component libraries.
typescript-advanced-types
Master TypeScript's advanced type system: generics, conditional types, mapped types, and utility types for type-safe applications.
nodejs-backend-patterns
Build production-ready Node.js backends with Express/Fastify, middleware patterns, auth, and database integration.
python-performance-optimization
Profile and optimize Python code using cProfile, memory profilers, and performance best practices.
brand-landingpage
Brand-first landing page designer with guided interviews and Stitch-powered iteration.
python-testing-patterns
Implement comprehensive testing strategies with pytest, fixtures, mocking, and test-driven development.