1---2name: architecture-paradigm-event-driven-43description: |4 Asynchronous event-based communication to decouple producers/consumers for scalability and resilience.56 Triggers: event-driven, message queue, pub/sub, asynchronous processing7 Use when: real-time workloads or multiple subsystems react to same events8 DO NOT use when: simple request-response patterns suffice.9version: 1.0.010category: architectural-pattern11tags: [architecture, event-driven, asynchronous, decoupling, scalability, resilience]12dependencies: []13tools: [message-broker, event-stream-processor, distributed-tracing]14usage_patterns:15 - paradigm-implementation16 - real-time-processing17 - system-extensibility18complexity: high19estimated_tokens: 80020metadata:21 source: https://skillmd.com/skills/majiayu000/architecture-paradigm-event-driven-422---2324# The Event-Driven Architecture Paradigm2526## When to Employ This Paradigm27- For real-time or bursty workloads (e.g., IoT, financial trading, logistics) where loose coupling and asynchronous processing are beneficial.28- When multiple, distinct subsystems must react to the same business or domain events.29- When system extensibility is a high priority, allowing new components to be added without modifying existing services.3031## Adoption Steps321. **Model the Events**: Define canonical event schemas, establish a clear versioning strategy, and assign ownership for each event type.332. **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).343. **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.354. **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.365. **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.3738## Key Deliverables39- 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).40- A centralized schema repository with automated CI validation and consumer-driven contract tests.41- Operational dashboards for monitoring system-wide throughput, consumer lag, and DLQ depth.4243## Risks & Mitigations44- **Hidden Coupling through Events**:45 - **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.46- **Operational Complexity and "Noise"**:47 - **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.48- **"Event Storming" Analysis Paralysis**:49 - **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.