← 返回
未分类 中文

Event Driven

Deep event-driven architecture workflow—events vs commands, ordering and idempotency, sagas, outbox pattern, observability, and failure modes. Use when desig...
深度事件驱动架构工作流——事件与命令、顺序性和幂等性、saga模式、发件箱模式、可观测性及故障模式。适用于设计...
mike47512 mike47512 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 498
下载
💾 2
安装
1
版本
#latest

概述

Event-Driven Architecture

Event-driven design trades tight coupling for asynchronous workflows—and introduces ordering, duplicates, schema evolution, and distributed tracing challenges.

When to Offer This Workflow

Trigger conditions:

  • Replacing long chains of synchronous HTTP calls
  • Adopting Kafka, Pub/Sub, EventBridge, NATS, etc.
  • Need for sagas, compensating transactions, or cross-service workflows

Initial offer:

Use six stages: (1) identify events, (2) contracts & versioning, (3) delivery semantics, (4) orchestration vs choreography, (5) observability, (6) failure & replay). Assume at-least-once delivery unless proven otherwise.


Stage 1: Identify Events

Goal: Distinguish domain events (facts that happened) from commands (requests). Assign owning bounded context per event type.

Exit condition: Event catalog: name, schema, producers, consumers, SLAs.


Stage 2: Contracts & Versioning

Goal: Schema registry or equivalent; backward-compatible evolution; consumers ignore unknown fields; deprecation policy for old versions.


Stage 3: Delivery Semantics

Goal: Partition keys for per-entity ordering; idempotent consumers; dedupe keys when exactly-once illusion is needed.


Stage 4: Orchestration vs Choreography

Goal: Central orchestrator (saga coordinator) vs decentralized choreography—trade visibility vs coupling.

Practices

  • Transactional outbox when DB write and event publish must align

Stage 5: Observability

Goal: Correlation ids on events; traces spanning HTTP → broker → consumer; lag and DLQ depth metrics.


Stage 6: Failure & Replay

Goal: Dead-letter queues, replay tooling, poison message handling, and idempotent replays.


Final Review Checklist

  • [ ] Event inventory with clear ownership
  • [ ] Versioned contracts and compatibility rules
  • [ ] Idempotent consumers; partition strategy documented
  • [ ] Saga/outbox where transactional consistency required
  • [ ] Tracing and replay operationalized

Tips for Effective Guidance

  • Choreography can hide flows—document critical sequences as diagrams.
  • Pair with message-queues and idempotency for implementation detail.

Handling Deviations

  • Low volume: start with a simple queue before full Kafka topology.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-31 07:01 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

dev-programming

Mcporter

steipete
使用 mcporter CLI 直接列出、配置、认证及调用 MCP 服务器/工具(支持 HTTP 或 stdio),涵盖临时服务器、配置编辑及 CLI/类型生成功能。
★ 196 📥 67,962
dev-programming

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 681 📥 329,434
design-media

Visual

mike47512
提供平面设计、UI交互、PPT美化及品牌调性升级指引。
★ 0 📥 2,222