Logo vun Architecture Event Driven

Architecture Event Driven

Communautéit
j4flmao
architecture-event-driven

Use this skill when the user says 'event-driven architecture', 'EDA', 'pub/sub between services', 'domain events', 'Kafka vs RabbitMQ vs SQS', 'dual write', 'transactional outbox', 'event schema', 'eventual consistency', 'choreography'. Designs asynchronous service integration: event vs command semantics, broker choice, delivery guarantees, outbox/inbox, ordering and partitioning, schema evolution, and tracing. Do NOT use for: implementation recipes inside one backend stack (backend/universal/event-driven, backend/universal/transactional-outbox), event sourcing as a persistence model (backend/universal/event-sourcing), or stream analytics (data/streaming).

Iwwersiicht

Editeurj4flmao
Repositoryagent-skills
Skill-Nummarchitecture-event-driven
Stären
41
Forks
6
Matgeliwwert Fichieren
1
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.

  • 1 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

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

Installatioun

Installéiert de KI-Skill Architecture Event Driven 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/event-driven
  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/event-driven .claude/skills/architecture-event-driven
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Architecture Event Driven 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 Event Driven 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 Event Driven 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.

Event-Driven Architecture

Purpose

In EDA, services publish facts ("OrderPlaced") and other services react, so producers do not depend on consumers being available or even known. The price is eventual consistency, harder debugging, and the need for reliable publishing and idempotent consumption. This skill covers the architectural decisions that make EDA correct, not just decoupled.

Agent Protocol

Trigger

"event-driven", "EDA", "domain events", "pub/sub", "message broker choice", "dual-write problem", "outbox", "at-least-once", "event ordering", "event versioning", "choreography".

Input Context

  • Business flows and which steps must be synchronous for the user.
  • Throughput, ordering needs (per entity?), retention/replay needs.
  • Existing infra (Kafka, RabbitMQ, cloud queues) and team experience.
  • Consistency requirements and failure tolerance.

Output Artifact

Event catalog, broker/topology choice, delivery and idempotency design, schema/versioning policy, observability plan.

Response Format

Event: {Name}(past tense) v{n}  Producer: {service}  Consumers: {services}
Key (ordering): {aggregate id}  Topic/queue: {name}  Retention: {duration}
Publish: outbox -> {relay: CDC|poller}  Delivery: at-least-once
Consumer: idempotent via {inbox table|natural upsert}; DLQ: {name}
Schema: {Avro|Protobuf|JSON Schema} compatibility={BACKWARD}

Completion Criteria

  • Each message classified as event (fact) or command (request).
  • No dual writes: outbox or CDC for publishing.
  • Consumers idempotent; DLQ and retry policy defined.
  • Ordering key chosen per aggregate where order matters.
  • Trace context propagated in message headers.

Events vs Commands vs Queries

KindMeaningAddressed toCan be rejected?Transport
Event"OrderPlaced" happenedAnyone interestedNo (it is a fact)Topic / pub-sub
Command"ReserveStock" pleaseOne ownerYesQueue or RPC
Query"What is the stock?"One ownern/aSync RPC

Event payload style: thin events (id + type; consumers call back for details) couple consumers to the producer API at read time; fat/event-carried state transfer (include the relevant data) lets consumers build local read models. Prefer fat events for integration, scoped to what consumers need.

Broker Choice

BrokerModelStrengthsWatch out
Kafka (or Redpanda)Partitioned replicated logReplay, high throughput, per-partition order, many consumer groupsOps complexity; ordering only within a partition
RabbitMQQueues with exchanges/routingFlexible routing, per-message acks, prioritiesReplay limited (streams feature helps)
AWS SNS + SQSFan-out topic → queuesManaged, simpleStandard queues unordered; FIFO queues have lower throughput
Google Pub/Sub, Azure Service Bus/Event HubsManaged pub/sub / logManaged scalingProvider-specific semantics
NATS JetStreamStreams + consumersLightweight, low latencySmaller ecosystem

Reliable Publishing: Transactional Outbox

Writing to the database and the broker separately can lose or invent events when one write fails. Write the event to an outbox table in the same transaction as the state change, then relay it.

sql
CREATE TABLE outbox (
  id            BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
  event_id      UUID NOT NULL UNIQUE,          -- consumers dedupe on this
  aggregate_id  TEXT NOT NULL,                 -- becomes the message key
  event_type    TEXT NOT NULL,
  payload       JSONB NOT NULL,
  created_at    TIMESTAMPTZ NOT NULL DEFAULT now(),
  published_at  TIMESTAMPTZ
);

BEGIN;
INSERT INTO orders (id, customer_id, total_cents) VALUES ($1, $2, $3);
INSERT INTO outbox (event_id, aggregate_id, event_type, payload)
VALUES ($4, $1, 'OrderPlaced.v1', $5);
COMMIT;

Relay options:

  • CDC (Debezium reading the WAL, with its outbox event router): low latency, no polling load.
  • Poller: SELECT ... WHERE published_at IS NULL ORDER BY id LIMIT 100 FOR UPDATE SKIP LOCKED, publish, then mark published. Simple; a crash between publish and mark causes a duplicate, which consumers must tolerate.

Either way delivery is at-least-once, never exactly-once end to end.

Idempotent Consumers (Inbox)

python
def handle(message, conn) -> None:
    event_id = message.headers["event_id"]
    with conn.transaction():
        inserted = conn.execute(
            "INSERT INTO inbox (event_id, received_at) VALUES (%s, now()) ON CONFLICT DO NOTHING",
            (event_id,),
        ).rowcount
        if inserted == 0:
            return                      # duplicate: already processed
        apply_business_change(conn, message.value)
    # commit offset / ack only after the transaction commits

Retry transient failures with bounded backoff; route poison messages to a dead-letter queue with the error attached; alert on DLQ depth.

Ordering and Partitioning

  • Order is only guaranteed within a partition/queue; use the aggregate id as the key so all events for one order land in order.
  • Consumers must not assume global order across aggregates.
  • Carry a per-aggregate version/sequence number so consumers can detect gaps or stale events.

Schema and Versioning

  • Use a schema registry (Avro/Protobuf/JSON Schema) with compatibility checks in CI.
  • Additive changes only (new optional fields); breaking change = new event type/version (OrderPlaced.v2), dual-publish during migration.
  • Standard envelope: CloudEvents attributes (id, source, type, specversion, time, subject) plus W3C traceparent header.

Observability

Propagate trace context through message headers (OpenTelemetry messaging conventions) so one trace links the HTTP request, the outbox relay, and every consumer. Track consumer lag, DLQ depth, and end-to-end latency (event time → processed time).

Hazards

HazardMitigation
Event pinball (chains across many services)Distributed tracing; prefer an orchestrated saga for multi-step business processes
Eventual consistency surprises in UIOptimistic UI, read-your-writes from the owning service, status polling or push
Consumer coupling to producer internalsPublish integration events, not table-row changes
Unbounded retries blocking a partitionRetry topics / DLQ with backoff
Lost events from dual writesOutbox or CDC only

Checklist

  • Event catalog with owners, keys, schemas, consumers.
  • Outbox/CDC publishing; no direct broker write inside business transactions.
  • Inbox or natural idempotency on every consumer.
  • DLQ + alerting; replay procedure documented.
  • Schema registry and compatibility gate.
  • Tracing headers and lag dashboards.

References

  • CQRS & Event Sourcing — read models and event-sourced aggregates.
  • Richardson, "Microservices Patterns" — transactional outbox, saga.
  • Debezium documentation: outbox event router; CloudEvents specification (CNCF).

Matgeliwwert Fichieren

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Architecture Event Driven?

Use this skill when the user says 'event-driven architecture', 'EDA', 'pub/sub between services', 'domain events', 'Kafka vs RabbitMQ vs SQS', 'dual write', 'transactional outbox', 'event schema', 'eventual consistency', 'choreography'. Designs asynchronous service integration: event vs command semantics, broker choice, delivery guarantees, outbox/inbox, ordering and partitioning, schema evolution, and tracing. Do NOT use for: implementation recipes inside one backend stack (backend/universal/event-driven, backend/universal/transactional-outbox), event sourcing as a persistence model (backe...

Firwat Architecture Event Driven op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Architecture Event Driven 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 Event Driven an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/j4flmao/agent-skills/tree/main/skills/architecture/event-driven an. TypingMind liest d'Datei SKILL.md, bündelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Architecture Event Driven 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 Event Driven benotzen?

Esou vill Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Architecture Event Driven 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 Event Driven 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 👇