Logo vun Architecture Microservices Patterns

Architecture Microservices Patterns

Communautéit
j4flmao
architecture-microservices-patterns

Use this skill when the user says 'microservices patterns', 'split the monolith', 'saga', 'circuit breaker', 'service decomposition', 'database per service', 'API gateway', 'strangler fig', 'distributed monolith', 'service-to-service resilience'. Decides whether and how to decompose into services, then applies the core patterns: decomposition by capability, data ownership, sagas, resilience (timeouts, retries, circuit breakers, bulkheads), gateway/BFF, and migration via strangler fig. Do NOT use for: domain modeling inside a service (architecture/system-design/domain-driven-design), messaging infrastructure details (architecture/event-driven), or Kubernetes/service-mesh operations (devops skills).

Iwwersiicht

Editeurj4flmao
Repositoryagent-skills
Skill-Nummarchitecture-microservices-patterns
Stären
41
Forks
6
Matgeliwwert Fichieren
Nëmmen Instruktiounen
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • Alles an den Instruktiounen

    Alles, wat de Modell brauch, steet an den Instruktiounen — keng zousätzlech Dateien ze synchroniséieren.

  • Open Source

    Vum j4flmao op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Architecture Microservices Patterns an TypingMind, fir e mat all LLM ze benotzen, oder füügt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vun GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier hei drënner an a bestätegt.
    https://github.com/j4flmao/agent-skills/tree/main/skills/architecture/system-design/microservices-patterns
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill afügen → Vu GitHub-URL, pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an de Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/j4flmao/agent-skills.git /tmp/agent-skills
mkdir -p .claude/skills
cp -r /tmp/agent-skills/skills/architecture/system-design/microservices-patterns .claude/skills/architecture-microservices-patterns
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Architecture Microservices Patterns an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Architecture Microservices Patterns automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Architecture Microservices Patterns net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Keys.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

Microservices Architecture Patterns

Purpose

Microservices buy independent deployment and scaling per business capability at the cost of distributed-systems complexity: partial failure, network latency, eventual consistency, and operational overhead. This skill covers when that trade is worth it and the patterns that keep a service landscape from becoming a distributed monolith.

Agent Protocol

Trigger

"microservices", "service decomposition", "monolith to microservices", "saga", "compensating transaction", "circuit breaker", "bulkhead", "API gateway", "database per service", "strangler fig".

Input Context

  • Team count and structure; deployment frequency pain.
  • Domain map / bounded contexts.
  • Current architecture and data model; cross-entity transactions.
  • SLOs and traffic patterns.

Output Artifact

Decomposition proposal, per-service data ownership, interaction style per flow, resilience policy table, migration plan.

Response Format

Decision: {modular monolith|microservices} because {reason}
Services: {name}: capability, owns {data}, team {x}
Flow {name}: {sync|async} via {REST|gRPC|events}; consistency {saga orchestration|choreography}
Resilience per call: timeout={ms} retries={n, backoff+jitter, idempotent?} breaker={threshold}
Migration: strangler step {n}: route {path} -> {service}

Completion Criteria

  • Services aligned to business capabilities/bounded contexts.
  • Each service owns its data; no shared tables.
  • Every remote call has timeout; retries only on idempotent operations.
  • Multi-service business transactions modeled as sagas with compensations.
  • Observability: tracing across services, per-service SLOs.

When (Not) to Use

SituationRecommendation
Small team, unclear domainModular monolith with enforced module boundaries
Many teams blocked by shared deploysExtract services along team/capability lines
One component with very different scaling/runtime needsExtract that component only
Desire for "modern architecture"Not a reason

Decomposition

  • By business capability / bounded context (Ordering, Payments, Shipping), not by technical layer or by table (entity services).
  • Services should be able to fulfill most requests with their own data; frequent synchronous chains (A → B → C → D) signal wrong boundaries.
  • Database per service: other services access data only via API or events; read models replicate what they need.

Communication

StyleUse forRisks
Sync REST/gRPCQueries, user-facing request/responseTemporal coupling, latency chains
Async eventsPropagating state changesEventual consistency
Async commands (queue)Work requests to one ownerNeed correlation and replies

Gateway/BFF: single entry point for clients handling routing, auth, rate limiting; a BFF per client type when needs diverge.

Sagas

A saga is a sequence of local transactions; on failure, previously completed steps are undone by compensating transactions.

VariantCoordinationProsCons
ChoreographyServices react to each other's eventsNo central componentFlow hard to see; cyclic dependencies
OrchestrationOrchestrator sends commands, tracks stateExplicit flow, easier monitoringOrchestrator is extra component
python
from __future__ import annotations

import logging
from dataclasses import dataclass
from typing import Callable

log = logging.getLogger("saga")


@dataclass(frozen=True)
class Step:
    name: str
    action: Callable[[dict], None]        # must be idempotent (keyed by saga_id)
    compensate: Callable[[dict], None]    # must be idempotent and retryable


class SagaFailed(RuntimeError):
    pass


def run_saga(saga_id: str, steps: list[Step], ctx: dict) -> None:
    done: list[Step] = []
    for step in steps:
        try:
            step.action({**ctx, "saga_id": saga_id})
            done.append(step)          # persist progress in production (durable saga log)
        except Exception as exc:
            log.error("saga=%s step=%s failed: %s; compensating %d steps",
                      saga_id, step.name, exc, len(done))
            for prev in reversed(done):
                prev.compensate({**ctx, "saga_id": saga_id})
            raise SagaFailed(f"saga {saga_id} failed at {step.name}") from exc

# run_saga("ord-981", [Step("reserve_stock", reserve, release),
#                      Step("charge_payment", charge, refund),
#                      Step("schedule_shipping", schedule, cancel_shipment)], {"order_id": "981"})

In production, persist saga state (or use a durable workflow engine such as Temporal) so a crash mid-saga resumes or compensates; design for semantic rollback (refund, release) because steps are visible to others before the saga ends. Put the step most likely to fail early and irreversible steps (send email, ship) last.

Resilience Patterns

PatternPurposeGuidance
TimeoutBound waitingEvery call; inner timeouts shorter than outer; propagate deadlines
RetrySurvive transient faults2-3 attempts, exponential backoff + full jitter, idempotent ops only, one layer only
Circuit breakerStop hammering a failing dependencyOpen on failure rate over a sliding window; half-open probes
BulkheadContain resource exhaustionSeparate pools/concurrency limits per dependency
FallbackDegrade gracefullyCached/default data, feature off
Rate limiting / load sheddingProtect capacityReject early with 429/503

Resilience4j (Spring Boot) example; Hystrix is in maintenance mode since 2018:

yaml
resilience4j:
  circuitbreaker:
    instances:
      payments:
        slidingWindowType: COUNT_BASED
        slidingWindowSize: 50
        minimumNumberOfCalls: 20
        failureRateThreshold: 50
        waitDurationInOpenState: 30s
        permittedNumberOfCallsInHalfOpenState: 5
  timelimiter:
    instances:
      payments:
        timeoutDuration: 2s
  retry:
    instances:
      payments:
        maxAttempts: 3
        waitDuration: 200ms
        enableExponentialBackoff: true
        exponentialBackoffMultiplier: 2
        enableRandomizedWait: true

Other stacks: Polly (.NET), gobreaker / failsafe-go (Go), opossum (Node.js), or mesh-level outlier detection and retries (Envoy/Istio). Avoid retrying in both the mesh and the application.

Migration: Strangler Fig

  1. Put a routing facade (gateway/proxy) in front of the monolith.
  2. Extract one capability; route its endpoints to the new service.
  3. Sync data during transition (CDC from the monolith DB or events), then cut ownership over.
  4. Delete the old code path; repeat. Never big-bang rewrite.

Anti-Patterns

Anti-patternSymptomFix
Distributed monolithLockstep deploys, shared DBData ownership, async integration, contract tests
Entity servicesCustomerService, AddressService chatty callsCapability-based boundaries
Synchronous chainsLatency and availability multiplyEvents, local read models
Retry stormsOutage amplificationRetry budgets, jitter, breakers
No tracingUndebuggable incidentsOpenTelemetry across services and queues
2PC across servicesBlocking, couplingSagas

Checklist

  • Decomposition justified by teams/capabilities.
  • Data ownership matrix; no shared schemas.
  • Per-dependency timeout/retry/breaker/bulkhead table.
  • Sagas with compensations, idempotent steps, durable state.
  • Outbox for events; idempotent consumers.
  • Gateway/BFF, service discovery, tracing, per-service SLOs.
  • Consumer-driven contract tests in CI.

References

  • Richardson, "Microservices Patterns" (2018) and microservices.io; Newman, "Building Microservices" 2nd ed. (2021).
  • Nygard, "Release It!" 2nd ed. — stability patterns; Garcia-Molina & Salem, "Sagas" (SIGMOD 1987).
  • Resilience4j documentation.

Heefeg gestallte Froen

Wat mécht de KI-Skill Architecture Microservices Patterns?

Use this skill when the user says 'microservices patterns', 'split the monolith', 'saga', 'circuit breaker', 'service decomposition', 'database per service', 'API gateway', 'strangler fig', 'distributed monolith', 'service-to-service resilience'. Decides whether and how to decompose into services, then applies the core patterns: decomposition by capability, data ownership, sagas, resilience (timeouts, retries, circuit breakers, bulkheads), gateway/BFF, and migration via strangler fig. Do NOT use for: domain modeling inside a service (architecture/system-design/domain-driven-design), messagi...

Firwat Architecture Microservices Patterns op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Architecture Microservices Patterns besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt amplaz vun engem Abonnement pro Benotzerplaz. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Architecture Microservices Patterns an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/j4flmao/agent-skills/tree/main/skills/architecture/system-design/microservices-patterns an. TypingMind liest d'Datei SKILL.md an installéiert de Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Architecture Microservices Patterns benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Architecture Microservices Patterns benotzen?

Esou vill Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Architecture Microservices Patterns domat benotzen – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama a méi – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Architecture Microservices Patterns gratis?

Jo. De Skill gëtt vum j4flmao ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbaart Pak vun Instruktiounen, dat engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt en nokënnt a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a keng Lafzäitëmfeld a funktionéiere mat all Modell.

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇