askill
microservice-architect

microservice-architectSafety 100Repository

Guide the planning of microservices architecture. Use when designing, planning, or architecting a system using microservices.

1 stars
1.2k downloads
Updated 2/22/2026

Package Files

Loading files...
SKILL.md

Microservice Architecture

Guided workflow for planning and designing microservices architecture.

When to Use

  • Designing new microservices system
  • Breaking down a monolith
  • Adding services to existing architecture
  • Evaluating service boundaries

Service Decomposition

Domain-Driven Design Approach

  1. Identify Bounded Contexts

    • Each context = potential service
    • Clear business capability ownership
    • Independent data ownership
  2. Map Service Boundaries

    ┌─────────────────┐  ┌─────────────────┐
    │  User Service   │  │  Order Service  │
    │                 │  │                 │
    │ • Registration  │  │ • Cart          │
    │ • Authentication│  │ • Checkout      │
    │ • Profile       │  │ • Order history │
    └─────────────────┘  └─────────────────┘
            │                    │
            └──────┬─────────────┘
                   ▼
    ┌─────────────────────────────────┐
    │      Notification Service       │
    │                                 │
    │ • Email                         │
    │ • SMS                           │
    │ • Push notifications            │
    └─────────────────────────────────┘
    
  3. Apply Single Responsibility

    • One service = one business capability
    • Changes isolated to single service
    • Independent deployment

Communication Patterns

Synchronous (REST/gRPC)

Use WhenAvoid When
Need immediate responseHigh latency tolerance
Simple request-responseFan-out to many services
Read operationsLong-running operations

Asynchronous (Events/Messages)

Use WhenAvoid When
Eventual consistency OKImmediate consistency required
Decoupling neededSimple request-response
Fan-out to multiple servicesLow complexity

Event-Driven Architecture

┌──────────────┐    publish     ┌─────────────────┐
│ Order Service│ ──────────────▶│   Event Bus     │
└──────────────┘  OrderCreated  └─────────────────┘
                                       │
                       ┌───────────────┼───────────────┐
                       ▼               ▼               ▼
              ┌──────────────┐ ┌──────────────┐ ┌──────────────┐
              │ Inventory    │ │ Notification │ │ Analytics    │
              │ Service      │ │ Service      │ │ Service      │
              └──────────────┘ └──────────────┘ └──────────────┘

Data Management

Database per Service

  • Each service owns its data
  • No shared databases
  • Data duplication acceptable

Data Consistency Patterns

PatternUse Case
SagaDistributed transactions
CQRSRead/write separation
Event SourcingAudit trail, temporal queries

Saga Pattern Example

Order Saga:
1. Order Service → Create order (PENDING)
2. Payment Service → Charge payment
   ├── Success → Continue
   └── Failure → Compensate: Cancel order
3. Inventory Service → Reserve items
   ├── Success → Continue
   └── Failure → Compensate: Refund, Cancel order
4. Order Service → Confirm order (CONFIRMED)

Resilience Patterns

Circuit Breaker

const circuitBreaker = new CircuitBreaker({
  failureThreshold: 5,      // Open after 5 failures
  successThreshold: 3,      // Close after 3 successes
  timeout: 30000,           // Half-open after 30s
  fallback: () => cachedResponse
})

const result = await circuitBreaker.execute(() => 
  externalService.call()
)

Retry with Backoff

const retryConfig = {
  maxRetries: 3,
  baseDelay: 1000,
  maxDelay: 10000,
  exponential: true,
  jitter: true
}

Bulkhead Pattern

  • Isolate resources per service
  • Prevent cascade failures
  • Limit concurrent requests

Service Discovery

# Kubernetes Service
apiVersion: v1
kind: Service
metadata:
  name: user-service
spec:
  selector:
    app: user-service
  ports:
    - port: 80
      targetPort: 3000

Observability

The Three Pillars

  1. Logging - Structured, correlated logs
  2. Metrics - RED metrics (Rate, Errors, Duration)
  3. Tracing - Distributed request tracing

Service Mesh Benefits

  • mTLS between services
  • Traffic management
  • Observability built-in
  • Retry/timeout policies

Architecture Decision Checklist

Before finalizing architecture:

  • Service boundaries clearly defined
  • Data ownership per service established
  • Communication patterns chosen
  • Consistency requirements documented
  • Failure scenarios identified
  • Resilience patterns decided
  • Observability strategy defined
  • Deployment strategy planned
  • Security boundaries established

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

94/100Analyzed 2/24/2026

High-quality technical reference skill covering microservices architecture comprehensively. Includes structured sections on service decomposition, communication patterns, data management, resilience patterns, and observability. Well-organized with decision tables, code examples, ASCII diagrams, and a practical checklist. Has clear 'when to use' guidance, relevant tags, and proper metadata. Generic enough to be widely reusable while maintaining depth.

100
95
95
90
90

Metadata

Licenseunknown
Version-
Updated2/22/2026
Publishermajiayu000

Tags

apidatabasegithub-actionsobservabilitysecurity