microservices-patterns

Design microservices architectures with service decomposition, event-driven communication, and resilience patterns.

Updated Jul 28, 2026
One-click install
npx skills add https://github.com/truongnat/Restly --skill microservices-patterns-truongnat
Or copy as Structured Prompt for Agentβ–Ό
Please help me install this Agent Skill.
Skill: microservices-patterns
Source: https://github.com/truongnat/Restly/tree/main/.agents/skills/microservices-patterns
Command: npx skills add https://github.com/truongnat/Restly --skill microservices-patterns-truongnat

SYSTEM DOCUMENTATION & REQUIREMENTS

πŸ’‘ This Skill includes references (resource) components.

What problem does it solve? Designing distributed systems is error-prone: unclear service boundaries, fragile inter-service calls, and distributed transaction failures can derail a microservices migration. This Skill provides proven architecture patterns and working code examples to guide those decisions. ## Core Features & Use Cases - Service Decomposition: Split monoliths by business capability, DDD subdomains, or the Strangler Fig pattern with clear ownership boundaries. - Communication Patterns: Implement synchronous REST/gRPC calls with retries, or asynchronous event-driven messaging with Kafka producers and consumers. - Data & Resilience: Apply database-per-service, Saga orchestration for distributed transactions, and circuit breakers with retry/backoff and bulkhead isolation. - Use Case: When decomposing a monolithic e-commerce app, use the Saga pattern example to coordinate order creation, inventory reservation, and payment processing with compensating actions on failure. ## Quick Start Ask the AI to design a microservices architecture for your system, including service boundaries, event-driven communication, and circuit breaker resilience patterns.

Frequently Asked Questions about microservices-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I decompose a monolith into microservices?β–Ό

Decompose by business capability or DDD subdomains, mapping bounded contexts to services with clear ownership. The Strangler Fig pattern lets you gradually extract functionality into new services while a proxy routes traffic between old and new systems.

How do microservices handle distributed transactions?β–Ό

Use the Saga pattern: break the transaction into local steps, each with a compensating action. If any step fails, execute compensations in reverse order to restore consistency, achieving eventual consistency instead of ACID across services.

Should microservices use synchronous or asynchronous communication?β–Ό

Use synchronous REST or gRPC for request/response queries needing immediate results. Use asynchronous events via Kafka or message queues for decoupled workflows, where services react to published domain events like OrderCreated.

How does the circuit breaker pattern prevent cascading failures?β–Ό

A circuit breaker tracks failures and opens after a threshold, rejecting calls immediately instead of waiting for timeouts. After a recovery timeout it enters half-open state, allowing test requests to verify the service recovered before closing again.

Can microservices share a single database?β–Ό

No, the database-per-service pattern requires each service to own its data to maintain loose coupling. Shared databases create tight coupling and deployment dependencies; services should exchange data through APIs or events instead.