Agent skill
microservices
Microservices architecture patterns and best practices. Service decomposition, inter-service communication, and distributed data management.
Install this agent skill to your Project
npx add-skill https://github.com/pluginagentmarketplace/custom-plugin-backend/tree/main/skills/microservices
SKILL.md
Microservices Skill
Bonded to: architecture-patterns-agent (Secondary)
Quick Start
# Invoke microservices skill
"Decompose my monolith into microservices"
"Design API gateway for my services"
"Implement Saga pattern for distributed transactions"
Decomposition Strategies
| Strategy | Best For | Complexity |
|---|---|---|
| By Business Capability | Clear domains | Medium |
| By Subdomain (DDD) | Complex domains | High |
| By Team | Conway's Law | Medium |
| Strangler Fig | Migration | Low |
Service Decomposition Example
E-commerce Monolith → Microservices
├── user-service # Authentication, profiles
├── product-service # Catalog, inventory
├── order-service # Orders, checkout
├── payment-service # Transactions
├── notification-service # Email, push, SMS
└── api-gateway # Routing, auth, rate limiting
Communication Patterns
Synchronous (REST/gRPC)
# Service-to-service call
import httpx
async def get_user_from_user_service(user_id: str):
async with httpx.AsyncClient() as client:
response = await client.get(f"http://user-service/users/{user_id}")
return response.json()
Asynchronous (Events)
# Event publishing
from kafka import KafkaProducer
producer = KafkaProducer(bootstrap_servers=['kafka:9092'])
def publish_order_created(order):
producer.send('order-events', {
'type': 'ORDER_CREATED',
'order_id': order.id,
'user_id': order.user_id
})
Anti-Patterns to Avoid
| Anti-Pattern | Sign | Solution |
|---|---|---|
| Distributed Monolith | Tight coupling | Define bounded contexts |
| Shared Database | Multiple services, one DB | Database per service |
| Chatty Services | Too many sync calls | Use async messaging |
| Data Inconsistency | No transaction strategy | Implement Saga |
Troubleshooting
| Issue | Cause | Solution |
|---|---|---|
| Cascading failures | No resilience | Circuit breakers |
| Data inconsistency | Distributed tx | Saga pattern |
| High latency | Chatty calls | Batch requests, cache |
Resources
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
languages
Master programming languages for backend development. Learn language selection, fundamentals, and ecosystem for JavaScript, Python, Go, Java, C#, PHP, Ruby, and Rust.
api-design
Design and build professional APIs with REST, GraphQL, and gRPC. Master authentication, documentation, testing, and operational concerns.
architecture
Master architectural design with SOLID principles, design patterns, microservices, and event-driven systems. Learn to design scalable backend systems.
testing
Backend testing strategies and test automation. Unit, integration, E2E, and load testing with best practices.
devops
Deploy applications with Docker and Kubernetes, automate with CI/CD, manage infrastructure with code, and configure cloud platforms and networking.
databases
Master relational and NoSQL databases. Learn PostgreSQL, MySQL, MongoDB, Redis, and other technologies for data persistence, optimization, and scaling.
Didn't find tool you were looking for?