微服务每服务独立数据库架构
Architecture
每服务独立数据库架构图,每个微服务拥有其专用数据存储,通过 Kafka 进行事件驱动同步以实现跨服务数据一致性。该模板展示了微服务数据隔离的核心原则,展示 PostgreSQL 和 MongoDB 如何在多语言持久化策略中共存。对于在保持最终一致性的同时强制服务自治的架构师至关重要。
Architecture
事件驱动通知中心架构图,展示多源事件摄取、基于模板的消息渲染、按用户偏好路由到邮件(SendGrid/SES)、推送(FCM)、短信(Twilio)和 Slack 渠道,以及交付跟踪和重试机制。该模板模拟将业务服务与交付基础设施解耦的集中式通知系统,支持用户控制偏好的多渠道通信。适合构建可扩展通知基础设施的平台团队。
Sources { # Event Sources
n1: rectangle label:"Order Service Event"
n2: rectangle label:"User Service Event"
n3: rectangle label:"Payment Service Event"
n4: rectangle label:"System Alert Event"
n1.handle(bottom) -> Hub.n5.handle(top) [label="OrderShipped"]
n2.handle(bottom) -> Hub.n5.handle(top) [label="AccountCreated"]
n3.handle(bottom) -> Hub.n5.handle(top) [label="PaymentFailed"]
n4.handle(bottom) -> Hub.n5.handle(top) [label="SystemDown"]
}
Hub { # Notification Hub
n5: rectangle label:"Receive Event"
n6: rectangle label:"Resolve Notification Template"
n7: rectangle label:"Check User Preferences"
n8: diamond label:"Channel Preference?"
n9: rectangle label:"Route to Email Channel"
n10: rectangle label:"Route to Push Channel"
n11: rectangle label:"Route to SMS Channel"
n12: rectangle label:"Route to Slack Channel"
n5.handle(right) -> n6.handle(left) [label="Match Template"]
n6.handle(right) -> n7.handle(left) [label="Render"]
n7.handle(right) -> n8.handle(left)
n8.handle(right) -> n9.handle(left) [label="Email"]
n8.handle(bottom) -> n10.handle(top) [label="Push"]
n8.handle(left) -> n11.handle(right) [label="SMS"]
n8.handle(bottom) -> n12.handle(top) [label="Slack"]
n9.handle(bottom) -> Delivery.n13.handle(top) [label="Send"]
n10.handle(bottom) -> Delivery.n14.handle(top) [label="Send"]
n11.handle(bottom) -> Delivery.n15.handle(top) [label="Send"]
n12.handle(bottom) -> Delivery.n16.handle(top) [label="Send"]
}
Delivery { # Delivery Providers
n13: rectangle label:"SendGrid / SES"
n14: rectangle label:"Firebase Cloud Messaging"
n15: rectangle label:"Twilio SMS"
n16: rectangle label:"Slack Webhook"
n17: rectangle label:"Delivery Status Tracker"
n18: diamond label:"Delivered?"
n19: rectangle label:"Log Success"
n20: rectangle label:"Retry or DLQ"
n13.handle(right) -> n17.handle(left) [label="Callback"]
n14.handle(right) -> n17.handle(left) [label="Callback"]
n15.handle(right) -> n17.handle(left) [label="Callback"]
n16.handle(right) -> n17.handle(left) [label="Callback"]
n17.handle(right) -> n18.handle(left)
n18.handle(right) -> n19.handle(left) [label="Yes"]
n18.handle(bottom) -> n20.handle(top) [label="No"]
}
When every microservice implements its own notification logic, you get inconsistent messaging, duplicated delivery infrastructure, and no centralized preference management. A notification hub centralizes all outbound communication, routing events to the right channel based on user preferences while providing unified delivery tracking and retry mechanisms.
Per-service notification logic creates inconsistency and duplication. Managed services like AWS SNS or Firebase handle delivery but not template management. This template shows the centralized notification hub with multi-channel routing.
| Template Name | 事件驱动通知中心架构 |
| Category | Architecture |
| Steps | 6 workflow steps |
| Format | FlowZap Code (.fz file) |
Architecture
每服务独立数据库架构图,每个微服务拥有其专用数据存储,通过 Kafka 进行事件驱动同步以实现跨服务数据一致性。该模板展示了微服务数据隔离的核心原则,展示 PostgreSQL 和 MongoDB 如何在多语言持久化策略中共存。对于在保持最终一致性的同时强制服务自治的架构师至关重要。
Architecture
事件驱动发布-订阅架构图,展示 Kafka 或 RabbitMQ 消息代理、事件序列化、主题分区、向多个消费者的扇出交付以及死信队列错误处理。该模板模拟了生产者和消费者通过消息代理完全解耦的基础异步消息传递模式。对于构建松耦合、可扩展的事件驱动系统的架构师至关重要。
Architecture
微服务 API 网关架构图,展示请求路由、JWT 身份验证、速率限制、服务发现以及跨分布式后端服务的响应聚合。该模板模拟微服务生态系统中所有客户端流量的入口点,在请求到达内部服务之前执行安全策略。适合设计具有集中式横切关注点的可扩展 API 基础设施的平台工程师。
Architecture
按业务能力组织的微服务分解架构图:身份认证、产品目录、定价和订单履行,每个都有独立的数据存储和 API。该模板展示如何将单体应用拆分为与业务领域对齐的服务,使用 Backend-for-Frontend (BFF) 模式进行客户端特定的聚合。适合规划领域驱动微服务边界的架构师。