Logo van Architecture Microservices Patterns

Architecture Microservices Patterns

Community
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).

Overzicht

Uitgeverj4flmao
Repositoryagent-skills
Skillnaamarchitecture-microservices-patterns
Sterren
41
Forks
6
Meegeleverde bestanden
Alleen instructies
LicentieMIT
Links
  • Instructies in Markdown

    Een SKILL.md-bestand dat het model laadt wanneer nodig, zodat het alleen tokens kost als een verzoek er daadwerkelijk bij past.

  • Werkt met elk LLM

    AI-skills zijn gewone Markdown, geen aanbiederspecifieke code. Daardoor werken ze met GPT, Claude, Gemini, Grok of een lokaal model.

  • Compleet zonder extra bestanden

    Alles wat het model nodig heeft, staat in de instructies — geen extra bestanden om te synchroniseren.

  • Open source

    Gepubliceerd door j4flmao op GitHub. Lees de broninhoud voordat je de skill installeert.

Installatie

Installeer de AI-skill Architecture Microservices Patterns in TypingMind om deze met elke LLM te gebruiken, of voeg de skill toe aan een andere agent die SKILL.md kan lezen.

1

Installeren in TypingMind

TypingMind installeert een skill rechtstreeks vanuit de GitHub-map — het leest SKILL.md, bundelt de bijbehorende bestanden en slaat het resultaat lokaal op.

  1. Open de app en ga naar Plug-ins → Skills.
  2. Kies "Installeren via GitHub".
  3. Plak de onderstaande URL van de skillmap en bevestig.
    https://github.com/j4flmao/agent-skills/tree/main/skills/architecture/system-design/microservices-patterns
  4. Schakel de skill in elke chat in waarin je deze beschikbaar wilt hebben.
Plug-ins → Skills → Nieuwe skill → Via GitHub-URL. Plak vervolgens de map-URL en druk op Doorgaan.
2

Installeren in een andere agent

Elke agent die het Agent Skills-formaat kan lezen, kan deze skill gebruiken — kopieer de map naar de skillmap van die 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 na het kopiëren opnieuw op, zodat de nieuwe skill wordt herkend.

Gebruik deze skill in TypingMind

Schakel Architecture Microservices Patterns in een willekeurige chat in TypingMind in en het model doet de rest. De naam en beschrijving staan in de systeemprompt. Zodra een verzoek erbij past, laadt het model zelf de volledige instructies — je hoeft de skill nooit handmatig aan te roepen en deze kost pas tokens wanneer je de skill daadwerkelijk gebruikt.

Het model laadt Architecture Microservices Patterns automatisch zodra een verzoek erbij past.

Werkt met elk AI-model

AI-skills zijn gewone Markdown-instructies in plaats van aanbiederspecifieke code. Daardoor is Architecture Microservices Patterns niet gebonden aan het model waarvoor de skill is geschreven. Installeer de skill één keer in TypingMind en gebruik deze met GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama of een lokaal model dat je zelf draait — allemaal met je eigen API-sleutels.

  • Alleen geladen wanneer nodig

    De systeemprompt bevat alleen de naam en beschrijving. De instructies worden bij het eerste bijpassende verzoek opgehaald, dus een ongebruikte skill kost niets.

  • Wissel van model tijdens een chat

    Omdat de skill uit instructies bestaat en niet uit code, blijft deze werken als je van model wisselt — het volgende model leest hetzelfde SKILL.md-bestand.

Skillinstructies

Dit is de inhoud van SKILL.md die het model laadt. Lees deze vóór de installatie — een skill bestaat uit instructies die je model zal volgen.

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.

Veelgestelde vragen

Wat doet de AI-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...

Waarom Architecture Microservices Patterns gebruiken in TypingMind?

Omdat je deze skill één keer installeert en met elk model kunt gebruiken. Architecture Microservices Patterns bestaat uit gewone Markdown in plaats van aanbiederspecifieke code. Dezelfde skill werkt dus met GPT-5, Claude, Gemini, Grok of een lokaal model, en je kunt midden in een chat van model wisselen zonder dat de skill niet meer werkt. TypingMind werkt met je eigen API-sleutels, dus je betaalt aanbieders rechtstreeks in plaats van een abonnement per gebruikersplek. Je skills en chats blijven in je eigen opslag.

Hoe installeer ik Architecture Microservices Patterns in TypingMind?

Open Plug-ins → Skills → Installeren vanaf GitHub in TypingMind en plak https://github.com/j4flmao/agent-skills/tree/main/skills/architecture/system-design/microservices-patterns. TypingMind leest het bestand SKILL.md en installeert het als een skill die je per chat kunt inschakelen.

Welke AI-modellen kunnen Architecture Microservices Patterns gebruiken?

Elk model dat je in TypingMind koppelt. AI-skills bestaan uit gewone Markdown-instructies in plaats van aanbiederspecifieke code. GPT, Claude, Gemini, Grok en lokale modellen kunnen deze skill dus allemaal laden wanneer een verzoek erbij past.

Hoeveel AI-modellen kan ik met Architecture Microservices Patterns gebruiken?

Zoveel als je wilt. Zolang een model skills ondersteunt, kun je Architecture Microservices Patterns ermee gebruiken: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama en meer. Allemaal in TypingMind met je eigen API-sleutels.

Is de AI-skill Architecture Microservices Patterns gratis?

Ja. Deze skill is door j4flmao op GitHub gepubliceerd onder de licentie MIT. Je betaalt alleen je eigen AI-aanbieder voor de tokens die je gebruikt.

Wat zijn AI-skills?

Een AI-skill is een herbruikbare bundel instructies die een AI-model leert hoe het één specifieke taak moet uitvoeren. Deze volgt het open Agent Skills-formaat: een bestand met de naam SKILL.md met een naam en beschrijving, plus eventuele scripts, sjablonen of referentiebestanden die het model nodig heeft. Het model leest de instructies alleen als je verzoek bij de skill past. Een geïnstalleerde skill kost dus niets zolang deze niet wordt gebruikt.

Waarin verschillen AI-skills van plug-ins of MCP-servers?

Een plug-in of MCP-server geeft een model nieuwe tools om aan te roepen: code die ergens wordt uitgevoerd en een resultaat teruggeeft. Een AI-skill geeft het model juist kennis en een werkwijze: hoe het een taak moet aanpakken, welke stappen het moet volgen en hoe goede uitvoer eruitziet. Skills bestaan uit gewone Markdown en hebben dus geen server, API-sleutel of runtime nodig. Ze werken met elk model.

Toon alles

Maak nu je eigen AI-werkruimte

Schrijf je in voor onze nieuwsbrief en blijf op de hoogte van nieuwe functies en toekomstige weggeefacties 👇