领域驱动设计限界上下文架构
Architecture
DDD 限界上下文架构图,订单、客户、物流和计费上下文通过防腐层、共享内核和定义集成关系的上下文映射连接。该模板可视化战略 DDD 模式,将复杂领域分解为通过明确定义的集成事件通信的自治限界上下文。对于将领域驱动设计应用于大规模企业系统的架构师至关重要。
Architecture
绞杀者模式迁移架构图,展示使用路由层在新旧系统之间分流流量,逐步用新微服务替换遗留单体应用。该模板模拟经过验证的迁移策略,新功能作为微服务构建,遗留端点逐步退役。对于在不进行高风险大爆炸重写的情况下现代化遗留系统的团队至关重要。
Client { # Client
n1: circle label:"User Request"
n2: rectangle label:"Anti-Corruption Layer"
n3: rectangle label:"Receive Response"
n4: circle label:"End"
n1.handle(right) -> n2.handle(left)
n2.handle(bottom) -> Router.n5.handle(top) [label="Translate"]
n3.handle(right) -> n4.handle(left)
}
Router { # Strangler Fig Router
n5: rectangle label:"Inspect Request Path"
n6: diamond label:"Migrated Endpoint?"
n7: rectangle label:"Route to New Service"
n8: rectangle label:"Route to Legacy Monolith"
n9: rectangle label:"Log Migration Metrics"
n5.handle(right) -> n6.handle(left)
n6.handle(right) -> n7.handle(left) [label="Yes"]
n6.handle(bottom) -> n8.handle(top) [label="No"]
n7.handle(bottom) -> NewServices.n10.handle(top) [label="Forward"]
n8.handle(bottom) -> Legacy.n14.handle(top) [label="Forward"]
n7.handle(right) -> n9.handle(left) [label="Track"]
n8.handle(right) -> n9.handle(left) [label="Track"]
}
NewServices { # New Microservices
n10: rectangle label:"Process in New Service"
n11: rectangle label:"New Service Database"
n12: rectangle label:"Publish Domain Event"
n13: rectangle label:"Return Response"
n10.handle(right) -> n11.handle(left) [label="Query"]
n11.handle(right) -> n12.handle(left) [label="Write"]
n12.handle(right) -> n13.handle(left)
n13.handle(top) -> Client.n3.handle(bottom) [label="New Response"]
}
Legacy { # Legacy Monolith
n14: rectangle label:"Process in Monolith"
n15: rectangle label:"Legacy Database"
n16: rectangle label:"Return Legacy Response"
n14.handle(right) -> n15.handle(left) [label="SQL"]
n15.handle(right) -> n16.handle(left) [label="Result"]
n16.handle(top) -> Client.n3.handle(bottom) [label="Legacy Response"]
}
Big-bang monolith rewrites fail 70% of the time due to scope creep, feature parity gaps, and business disruption. The strangler fig pattern enables incremental migration by routing traffic between the legacy monolith and new microservices, allowing teams to migrate one endpoint at a time with zero downtime and instant rollback capability.
Big-bang rewrites are risky and expensive. Running parallel systems without a router creates confusion. Branch-by-abstraction works for libraries but not for services. This template visualizes the proven incremental migration strategy.
| Template Name | 微服务绞杀者模式迁移架构 |
| Category | Architecture |
| Steps | 6 workflow steps |
| Format | FlowZap Code (.fz file) |
Architecture
DDD 限界上下文架构图,订单、客户、物流和计费上下文通过防腐层、共享内核和定义集成关系的上下文映射连接。该模板可视化战略 DDD 模式,将复杂领域分解为通过明确定义的集成事件通信的自治限界上下文。对于将领域驱动设计应用于大规模企业系统的架构师至关重要。
Architecture
微服务 API 网关架构图,展示请求路由、JWT 身份验证、速率限制、服务发现以及跨分布式后端服务的响应聚合。该模板模拟微服务生态系统中所有客户端流量的入口点,在请求到达内部服务之前执行安全策略。适合设计具有集中式横切关注点的可扩展 API 基础设施的平台工程师。
Architecture
每服务独立数据库架构图,每个微服务拥有其专用数据存储,通过 Kafka 进行事件驱动同步以实现跨服务数据一致性。该模板展示了微服务数据隔离的核心原则,展示 PostgreSQL 和 MongoDB 如何在多语言持久化策略中共存。对于在保持最终一致性的同时强制服务自治的架构师至关重要。
Architecture
按业务能力组织的微服务分解架构图:身份认证、产品目录、定价和订单履行,每个都有独立的数据存储和 API。该模板展示如何将单体应用拆分为与业务领域对齐的服务,使用 Backend-for-Frontend (BFF) 模式进行客户端特定的聚合。适合规划领域驱动微服务边界的架构师。