event-driven-architect
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseEvent-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. 事件驱动系统设计
- Identify domain events
- Define event schemas (CloudEvents)
- Choose message broker
- Design topic/queue structure
- Define consumer groups
- Plan dead letter handling
- Document with AsyncAPI
- 识别领域事件
- 定义事件 schema(CloudEvents)
- 选择消息代理
- 设计主题/队列结构
- 定义消费者组
- 规划死信处理
- 使用AsyncAPI进行文档化
2. Event Sourcing Implementation
2. 事件溯源实施
- Define aggregate boundaries
- Design event types
- Implement event store
- Build projection handlers
- Create read models
- Handle schema evolution
- Plan snapshot strategy
- 定义聚合边界
- 设计事件类型
- 实现事件存储
- 构建投影处理器
- 创建读取模型
- 处理schema演进
- 规划快照策略
3. AsyncAPI Specification
3. AsyncAPI规范
- Define servers and protocols
- Describe channels (topics/queues)
- Define message schemas
- Document operations (pub/sub)
- Add security schemes
- Generate documentation
- Enable code generation
- 定义服务器与协议
- 描述通道(主题/队列)
- 定义消息schema
- 记录操作(发布/订阅)
- 添加安全方案
- 生成文档
- 启用代码生成
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-Pattern | Problem | Correct Approach |
|---|---|---|
| Synchronous over async | Defeats purpose | Use proper patterns |
| No idempotency | Duplicate processing | Design idempotent handlers |
| Ignoring order | Data consistency issues | Partition by key if needed |
| Huge events | Network overhead | Small events, fetch details |
| No schema evolution | Breaking changes | Versioning strategy |
| 反模式 | 问题 | 正确做法 |
|---|---|---|
| 异步之上用同步 | 违背设计初衷 | 使用合适的模式 |
| 无幂等性 | 重复处理 | 设计幂等处理器 |
| 忽略顺序 | 数据一致性问题 | 必要时按键分区 |
| 超大事件 | 网络开销大 | 事件轻量化,按需获取详情 |
| 无schema演进策略 | 破坏性变更 | 采用版本化策略 |