event-driven-architect

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Event-Driven Architect

事件驱动架构

Purpose

用途

Provides expertise in designing and implementing event-driven architectures. Covers message brokers, event sourcing, CQRS, and standards like CloudEvents and AsyncAPI for building scalable, decoupled systems.
提供事件驱动架构的设计与实施专业知识。涵盖消息代理、事件溯源、CQRS,以及CloudEvents和AsyncAPI等标准,用于构建可扩展、解耦的系统。

When to Use

适用场景

  • Designing event-driven architectures
  • Implementing message queues and brokers
  • Building event sourcing systems
  • Implementing CQRS patterns
  • Creating AsyncAPI specifications
  • Designing event mesh topologies
  • Building asynchronous microservices
  • 设计事件驱动架构
  • 实现消息队列与代理
  • 构建事件溯源系统
  • 实施CQRS模式
  • 创建AsyncAPI规范
  • 设计事件网格拓扑
  • 构建异步微服务

Quick Start

快速入门

Invoke this skill when:
  • Designing event-driven architectures
  • Implementing message queues and brokers
  • Building event sourcing systems
  • Implementing CQRS patterns
  • Creating AsyncAPI specifications
Do NOT invoke when:
  • Building synchronous REST APIs (use api-designer)
  • Setting up Kafka infrastructure (use data-engineer)
  • Building workflow orchestration (use workflow-orchestrator)
  • Designing GraphQL APIs (use graphql-architect)
调用此技能的场景:
  • 设计事件驱动架构
  • 实现消息队列与代理
  • 构建事件溯源系统
  • 实施CQRS模式
  • 创建AsyncAPI规范
请勿调用的场景:
  • 构建同步REST API(请使用api-designer)
  • 搭建Kafka基础设施(请使用data-engineer)
  • 构建工作流编排(请使用workflow-orchestrator)
  • 设计GraphQL API(请使用graphql-architect)

Decision Framework

决策框架

Message Broker Selection:
├── High throughput, streaming → Kafka
├── Flexible routing → RabbitMQ
├── Cloud-native, serverless → EventBridge, Pub/Sub
├── Simple queuing → SQS, Redis Streams
└── Enterprise integration → Azure Service Bus

Pattern Selection:
├── Audit/replay needed → Event Sourcing
├── Read/write separation → CQRS
├── Simple async → Pub/Sub
├── Guaranteed delivery → Transactional outbox
└── Complex routing → Message router
消息代理选择:
├── 高吞吐量、流处理 → Kafka
├── 灵活路由 → RabbitMQ
├── 云原生、无服务器 → EventBridge, Pub/Sub
├── 简单队列 → SQS, Redis Streams
└── 企业级集成 → Azure Service Bus

模式选择:
├── 需要审计/重放 → 事件溯源
├── 读写分离 → CQRS
├── 简单异步 → 发布/订阅(Pub/Sub)
├── 确保交付 → 事务性发件箱
└── 复杂路由 → 消息路由器

Core Workflows

核心工作流

1. Event-Driven System Design

1. 事件驱动系统设计

  1. Identify domain events
  2. Define event schemas (CloudEvents)
  3. Choose message broker
  4. Design topic/queue structure
  5. Define consumer groups
  6. Plan dead letter handling
  7. Document with AsyncAPI
  1. 识别领域事件
  2. 定义事件 schema(CloudEvents)
  3. 选择消息代理
  4. 设计主题/队列结构
  5. 定义消费者组
  6. 规划死信处理
  7. 使用AsyncAPI进行文档化

2. Event Sourcing Implementation

2. 事件溯源实施

  1. Define aggregate boundaries
  2. Design event types
  3. Implement event store
  4. Build projection handlers
  5. Create read models
  6. Handle schema evolution
  7. Plan snapshot strategy
  1. 定义聚合边界
  2. 设计事件类型
  3. 实现事件存储
  4. 构建投影处理器
  5. 创建读取模型
  6. 处理schema演进
  7. 规划快照策略

3. AsyncAPI Specification

3. AsyncAPI规范

  1. Define servers and protocols
  2. Describe channels (topics/queues)
  3. Define message schemas
  4. Document operations (pub/sub)
  5. Add security schemes
  6. Generate documentation
  7. Enable code generation
  1. 定义服务器与协议
  2. 描述通道(主题/队列)
  3. 定义消息schema
  4. 记录操作(发布/订阅)
  5. 添加安全方案
  6. 生成文档
  7. 启用代码生成

Best Practices

最佳实践

  • Use CloudEvents format for interoperability
  • Design idempotent consumers
  • Implement dead letter queues
  • Version event schemas carefully
  • Monitor consumer lag
  • Plan for at-least-once delivery
  • 使用CloudEvents格式以实现互操作性
  • 设计幂等消费者
  • 实现死信队列
  • 谨慎版本化事件schema
  • 监控消费者延迟
  • 规划至少一次交付机制

Anti-Patterns

反模式

Anti-PatternProblemCorrect Approach
Synchronous over asyncDefeats purposeUse proper patterns
No idempotencyDuplicate processingDesign idempotent handlers
Ignoring orderData consistency issuesPartition by key if needed
Huge eventsNetwork overheadSmall events, fetch details
No schema evolutionBreaking changesVersioning strategy
反模式问题正确做法
异步之上用同步违背设计初衷使用合适的模式
无幂等性重复处理设计幂等处理器
忽略顺序数据一致性问题必要时按键分区
超大事件网络开销大事件轻量化,按需获取详情
无schema演进策略破坏性变更采用版本化策略