microservices-patterns

Design microservices architectures with decomposition, communication, and resilience patterns.

Updated Dec 20, 2023
One-click install
npx skills add https://github.com/Thiago-Cruz-eng/Hibrygame --skill microservices-patterns-thiago-cruz-eng
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: microservices-patterns
Source: https://github.com/Thiago-Cruz-eng/Hibrygame/tree/main/.claude/skills/microservices-patterns
Command: npx skills add https://github.com/Thiago-Cruz-eng/Hibrygame --skill microservices-patterns-thiago-cruz-eng

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It solves the difficulty of designing microservices that communicate correctly, manage distributed data safely, and stay resilient under partial failures.

Core Features & Use Cases

  • Service decomposition strategies: Choose bounded contexts via business capability or DDD, and use Strangler Fig to incrementally extract from a monolith.
  • Communication pattern design: Implement synchronous request/response (REST/gRPC/GraphQL) and asynchronous event-driven messaging (queues/streaming).
  • Distributed data & transactions: Apply database-per-service and Saga-based compensating workflows to avoid tight coupling and global transactions.

Quick Start

Use this skill to produce a microservices architecture blueprint that defines service boundaries, message/event contracts, data ownership rules, and resilience tactics for circuit breaking, retries with backoff, and bulkheads.

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 without breaking existing functionality?

Microservices decomposition uses the Strangler Fig pattern to incrementally extract bounded contexts identified via business capabilities or DDD, ensuring the monolith remains functional during migration. This approach defines clear service boundaries and contracts to maintain system integrity throughout the transition.

What is the Saga pattern and when do I need it for distributed transactions?

The Saga pattern manages distributed data consistency through compensating workflows, avoiding global transactions across services. You need Saga-based eventual consistency when applying database-per-service ownership, ensuring microservices remain decoupled while coordinating multi-step business processes safely.

How does a circuit breaker improve microservices resilience under partial failures?

A circuit breaker improves microservices resilience by stopping cascading failures when a downstream service is unavailable. Combined with retry strategies using exponential backoff and bulkheads for resource isolation, it prevents total system collapse during partial outages and maintains service availability.

Should I use synchronous REST or asynchronous event-driven messaging for inter-service communication?

Synchronous request/response via REST, gRPC, or GraphQL suits operations needing immediate consistency, while asynchronous event-driven messaging via queues or streaming enables loose coupling and scalability. Your choice depends on whether the interaction requires real-time responses or can tolerate eventual consistency.

What's the best way to define service boundaries and contracts in an event-driven architecture?

Defining service boundaries relies on identifying bounded contexts through business capabilities or domain-driven design. In event-driven architectures, you establish explicit message and event contracts alongside strict data ownership rules, ensuring each service maintains autonomy while communicating asynchronously.

Why does database-per-service require changes to how I handle distributed data?

Database-per-service prevents tight coupling by giving each microservice exclusive ownership of its data. This constraint eliminates global transactions, requiring you to adopt Saga-based compensating workflows and event-driven coordination to maintain data consistency across service boundaries safely.