Files
nexus/wiki/concepts/Fan-out-Pattern.md
2026-04-20 00:02:56 +08:00

25 lines
967 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "Fan-out Pattern"
type: concept
tags:
- Messaging
- EDA
- Architecture
date: 2026-04-19
---
## Definition
Fan-out Pattern扇出模式是一种消息传递模式一个事件可以同时分发给多个消费者。当一个事件需要触发多个独立的处理流程时扇出模式可以高效实现一对多的通知机制。
## Implementation
- **SNS Topic**:发布/订阅模式,一个消息发布到主题,多个订阅者接收
- **EventBridge Rule**:基于规则将事件路由到多个目标
## Use Cases
- 单个订单创建事件触发:库存更新、通知发送、数据分析、财务处理等多个独立流程
- 用户注册事件触发:欢迎邮件、积分奖励、偏好初始化等多个独立业务逻辑
## Relationship
- [[Event-Driven Architecture]] ← uses ← [[Fan-out Pattern]]
- [[Fan-out Pattern]] ← implemented_by ← [[Amazon SNS]]
- [[Fan-out Pattern]] ← implemented_by ← [[EventBridge]]