微服务每服务独立数据库架构
Architecture
每服务独立数据库架构图,每个微服务拥有其专用数据存储,通过 Kafka 进行事件驱动同步以实现跨服务数据一致性。该模板展示了微服务数据隔离的核心原则,展示 PostgreSQL 和 MongoDB 如何在多语言持久化策略中共存。对于在保持最终一致性的同时强制服务自治的架构师至关重要。
Architecture
事件驱动发布-订阅架构图,展示 Kafka 或 RabbitMQ 消息代理、事件序列化、主题分区、向多个消费者的扇出交付以及死信队列错误处理。该模板模拟了生产者和消费者通过消息代理完全解耦的基础异步消息传递模式。对于构建松耦合、可扩展的事件驱动系统的架构师至关重要。
Producer { # Event Producer
n1: circle label:"Business Action"
n2: rectangle label:"Create Domain Event"
n3: rectangle label:"Serialize Event"
n4: rectangle label:"Publish to Topic"
n1.handle(right) -> n2.handle(left)
n2.handle(right) -> n3.handle(left) [label="OrderCreated"]
n3.handle(right) -> n4.handle(left) [label="Avro/JSON"]
n4.handle(bottom) -> Broker.n5.handle(top) [label="Produce"]
}
Broker { # Message Broker (Kafka/RabbitMQ)
n5: rectangle label:"Receive Event"
n6: rectangle label:"Partition by Key"
n7: rectangle label:"Persist to Log"
n8: rectangle label:"Fan-Out to Subscribers"
n5.handle(right) -> n6.handle(left)
n6.handle(right) -> n7.handle(left) [label="Append"]
n7.handle(right) -> n8.handle(left) [label="Notify"]
n8.handle(bottom) -> Consumers.n9.handle(top) [label="Deliver"]
}
Consumers { # Event Consumers
n9: rectangle label:"Inventory Consumer"
n10: diamond label:"Processing OK?"
n11: rectangle label:"Update Stock Level"
n12: rectangle label:"Send to Dead Letter Queue"
n13: rectangle label:"Notification Consumer"
n14: rectangle label:"Send Order Email"
n15: rectangle label:"Analytics Consumer"
n16: rectangle label:"Update Dashboard"
n9.handle(right) -> n10.handle(left)
n10.handle(right) -> n11.handle(left) [label="Yes"]
n10.handle(bottom) -> n12.handle(top) [label="No"]
n11.handle(right) -> n13.handle(left)
n13.handle(right) -> n14.handle(left) [label="Email"]
n14.handle(right) -> n15.handle(left)
n15.handle(right) -> n16.handle(left) [label="Aggregate"]
}
Synchronous request-response communication between microservices creates tight coupling, cascading failures, and latency chains. The publish-subscribe pattern decouples producers from consumers through a message broker, enabling independent scaling, temporal decoupling, and resilient event processing with built-in retry mechanisms.
Synchronous HTTP calls are simpler but create coupling. Point-to-point queues limit fan-out. Managed services like AWS SNS/SQS or Google Pub/Sub reduce operational overhead. This template visualizes the complete pub/sub lifecycle including error handling.
| Template Name | 事件驱动发布-订阅架构 |
| Category | Architecture |
| Steps | 6 workflow steps |
| Format | FlowZap Code (.fz file) |
Architecture
每服务独立数据库架构图,每个微服务拥有其专用数据存储,通过 Kafka 进行事件驱动同步以实现跨服务数据一致性。该模板展示了微服务数据隔离的核心原则,展示 PostgreSQL 和 MongoDB 如何在多语言持久化策略中共存。对于在保持最终一致性的同时强制服务自治的架构师至关重要。
Architecture
事件驱动智能体AI架构,用Kafka/PubSub主题替换中央编排器:智能体订阅、响应并发布新事件。这使多智能体系统与经过验证的微服务编舞保持一致,适合实时、高吞吐量系统和"智能体网格"配置。
Architecture
使用Kafka风格事件代理的事件驱动智能体网格架构。多个智能体订阅主题(订单、警报、分析),独立处理事件,并将结果发布回总线。最适合实时事件处理和解耦服务架构。
Architecture
实时事件流管道架构图,IoT 传感器、应用日志和用户点击流数据通过 Kafka 流入 Apache Flink 进行窗口聚合、异常检测以及向数据湖和仪表板的多目标输出。该模板可视化从摄取到转换、存储和告警的端到端流处理。对于构建实时分析和监控平台的数据工程师至关重要。
Architecture
死信队列架构图,展示重试策略、指数退避、最大重试阈值、失败消息的 DLQ 路由、运维告警和手动重处理工作流。该模板模拟异步消息系统的关键错误处理模式,确保处理失败时不会静默丢失任何消息。对于构建具有适当故障恢复机制的可靠事件驱动系统至关重要。