home / skills / athola / claude-night-market / architecture-paradigm-event-driven

architecture-paradigm-event-driven skill

/plugins/archetypes/skills/architecture-paradigm-event-driven

This skill helps you implement and optimize event-driven architectures by guiding topology, fault handling, and observability for scalable asynchronous systems.

npx playbooks add skill athola/claude-night-market --skill architecture-paradigm-event-driven

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
3.7 KB
---
name: architecture-paradigm-event-driven
description: 'Asynchronous event-based communication to decouple producers/consumers
  for scalability and resilience.


  Triggers: event-driven, message queue, pub/sub, asynchronous, decoupling

  Use when: real-time workloads or multiple subsystems react to same events

  DO NOT use when: selecting paradigms (use architecture-paradigms first), simple request-response.'
category: architectural-pattern
tags:
- architecture
- event-driven
- asynchronous
- decoupling
- scalability
- resilience
dependencies: []
tools:
- message-broker
- event-stream-processor
- distributed-tracing
usage_patterns:
- paradigm-implementation
- real-time-processing
- system-extensibility
complexity: high
estimated_tokens: 800
---

# The Event-Driven Architecture Paradigm


## When To Use

- Building async, loosely-coupled systems
- Systems with complex event processing pipelines

## When NOT To Use

- Simple request-response applications without async needs
- Systems requiring strong transactional consistency

## When to Employ This Paradigm
- For real-time or bursty workloads (e.g., IoT, financial trading, logistics) where loose coupling and asynchronous processing are beneficial.
- When multiple, distinct subsystems must react to the same business or domain events.
- When system extensibility is a high priority, allowing new components to be added without modifying existing services.

## Adoption Steps
1. **Model the Events**: Define canonical event schemas, establish a clear versioning strategy, and assign ownership for each event type.
2. **Select the Right Topology**: For each data flow, make a deliberate choice between choreography (e.g., a simple pub/sub model) and orchestration (e.g., a central controller or saga orchestrator).
3. **Engineer the Event Platform**: Choose the appropriate event brokers or message meshes. Configure critical parameters such as message ordering, topic partitions, and data retention policies.
4. **Plan for Failure Handling**: Implement production-grade mechanisms for handling message failures, including Dead-Letter Queues (DLQs), automated retry logic, idempotent consumers, and tools for replaying events.
5. **Instrument for Observability**: Implement detailed monitoring to track key metrics such as consumer lag, message throughput, schema validation failures, and the health of individual consumer applications.

## Key Deliverables
- An Architecture Decision Record (ADR) that documents the event taxonomy, the chosen broker technology, and the governance policies (e.g., for naming, versioning, and retention).
- A centralized schema repository with automated CI validation and consumer-driven contract tests.
- Operational dashboards for monitoring system-wide throughput, consumer lag, and DLQ depth.

## Risks & Mitigations
- **Hidden Coupling through Events**:
  - **Mitigation**: Consumers may implicitly depend on undocumented event semantics or data fields. Publish a formal event catalog or schema registry and use linting tools to enforce event structure.
- **Operational Complexity and "Noise"**:
  - **Mitigation**: Without strong observability, diagnosing failed or "stuck" consumers is extremely difficult. Enforce the use of distributed tracing and standardized alerting across all event-driven components.
- **"Event Storming" Analysis Paralysis**:
  - **Mitigation**: While event storming workshops are valuable, they can become unproductive if not properly managed. Keep modeling sessions time-boxed and focused on high-value business contexts first.
## Troubleshooting

### Common Issues

**Command not found**
Ensure all dependencies are installed and in PATH

**Permission errors**
Check file permissions and run with appropriate privileges

**Unexpected behavior**
Enable verbose logging with `--verbose` flag

Overview

This skill provides practical guidance and deliverables for adopting an event-driven architecture to decouple producers and consumers for scalability and resilience. It captures modeling, topology choices, platform engineering, failure handling, and observability practices to run production-grade asynchronous systems. Use it to design reliable pub/sub or message-queue-based systems that must scale, evolve, and tolerate partial failures.

How this skill works

The skill inspects system requirements and recommends an event model, topology (choreography vs orchestration), and broker choices. It prescribes concrete engineering steps: define canonical event schemas, configure broker parameters, add DLQs and retries, and instrument for consumer lag, throughput, and tracing. Deliverables include ADRs, a centralized schema repository, and operational dashboards to validate the architecture.

When to use it

  • Building asynchronous, loosely coupled systems where producers and consumers must scale independently
  • Real-time or bursty workloads such as IoT, trading, or logistics that need non-blocking processing
  • When multiple subsystems must react to the same business events without tight coupling
  • When extensibility matters and new consumers should be added without changing producers

Best practices

  • Model and version events up front; publish a schema registry and enforce CI checks
  • Choose topology per data flow: use choreography for simple fan-out and orchestration for sagas or coordinated workflows
  • Enforce idempotent consumers and use DLQs plus bounded retries to handle failures gracefully
  • Instrument consumers and brokers: monitor consumer lag, throughput, DLQ depth, and distributed traces
  • Document an ADR that records event taxonomy, chosen broker, governance, naming, and retention policies

Example use cases

  • An order processing pipeline where payments, shipping, and notifications subscribe to the same order-created events
  • Telemetry collection from distributed devices (IoT) that emit bursts of events to be processed asynchronously
  • Analytics and enrichment pipelines that consume raw events, enrich them, and forward to downstream services
  • Saga-based long-running transactions coordinated by an orchestrator using events for state transitions

FAQ

When should I prefer orchestration over choreography?

Use orchestration when you need coordinated, multi-step workflows with central error handling, compensations, or complex sequencing. Use choreography for simple fan-out and independent reactions.

How do I prevent hidden coupling between services?

Publish formal event contracts in a schema registry, version events, require consumer-driven contract tests, and lint event payloads to detect undocumented field usage.