无服务器 Step Functions 编排架构
Architecture
AWS Step Functions 编排架构图,展示状态机工作流,包括选择状态、并行处理、等待回调模式以及失败步骤的补偿回滚。该模板模拟无服务器工作流编排,复杂的多步骤流程定义为具有内置错误处理和重试逻辑的状态机。对于构建需要人工审批或长时间运行流程的可靠无服务器工作流的团队至关重要。
Architecture
熔断器弹性架构图,展示完整的状态机,包括关闭、打开和半开状态、故障阈值跟踪、恢复计时器以及保护服务免受级联故障的降级响应策略。该模板详细可视化熔断器模式,包括熔断器如何根据成功和失败计数在状态之间转换。对于构建在负载下优雅降级的容错微服务至关重要。
Client { # Client Service
n1: circle label:"Service Call"
n2: rectangle label:"Circuit Breaker Proxy"
n3: rectangle label:"Receive Response"
n4: circle label:"End"
n1.handle(right) -> n2.handle(left)
n2.handle(bottom) -> Breaker.n5.handle(top) [label="Check State"]
n3.handle(right) -> n4.handle(left)
}
Breaker { # Circuit Breaker
n5: diamond label:"Circuit State?"
n6: rectangle label:"Forward Request (Closed)"
n7: rectangle label:"Return Fallback (Open)"
n8: rectangle label:"Test Request (Half-Open)"
n9: rectangle label:"Track Success"
n10: rectangle label:"Track Failure"
n11: diamond label:"Failure Threshold?"
n12: rectangle label:"Trip Circuit Open"
n13: rectangle label:"Reset to Closed"
n14: rectangle label:"Start Recovery Timer"
n5.handle(right) -> n6.handle(left) [label="Closed"]
n5.handle(bottom) -> n7.handle(top) [label="Open"]
n5.handle(left) -> n8.handle(right) [label="Half-Open"]
n6.handle(bottom) -> Downstream.n15.handle(top) [label="Forward"]
n7.handle(top) -> Client.n3.handle(bottom) [label="Cached/Default"]
n8.handle(bottom) -> Downstream.n15.handle(top) [label="Probe"]
n9.handle(right) -> n13.handle(left) [label="Healthy"]
n10.handle(right) -> n11.handle(left)
n11.handle(right) -> n12.handle(left) [label="Exceeded"]
n11.handle(top) -> n6.handle(bottom) [label="Below"]
n12.handle(right) -> n14.handle(left) [label="Cooldown"]
n14.handle(top) -> n8.handle(bottom) [label="Timer Expired"]
}
Downstream { # Downstream Service
n15: rectangle label:"Process Request"
n16: diamond label:"Response OK?"
n17: rectangle label:"Return Success"
n18: rectangle label:"Return Error/Timeout"
n15.handle(right) -> n16.handle(left)
n16.handle(right) -> n17.handle(left) [label="200"]
n16.handle(bottom) -> n18.handle(top) [label="5xx/Timeout"]
n17.handle(top) -> Breaker.n9.handle(bottom) [label="Success"]
n18.handle(top) -> Breaker.n10.handle(bottom) [label="Failure"]
n17.handle(top) -> Client.n3.handle(bottom) [label="Response"]
}
When a downstream service fails, continuing to send requests wastes resources and can cascade failures across the entire system. The circuit breaker pattern detects failures, stops sending requests to unhealthy services, and automatically recovers when the service heals—preventing cascading failures and enabling graceful degradation.
Simple retry logic does not prevent cascading failures. Timeout-based approaches waste resources waiting. Libraries like Resilience4j, Polly, or Hystrix implement circuit breakers. This template visualizes the complete state machine for understanding the pattern.
| Template Name | 熔断器弹性架构 |
| Category | Architecture |
| Steps | 6 workflow steps |
| Format | FlowZap Code (.fz file) |
Architecture
AWS Step Functions 编排架构图,展示状态机工作流,包括选择状态、并行处理、等待回调模式以及失败步骤的补偿回滚。该模板模拟无服务器工作流编排,复杂的多步骤流程定义为具有内置错误处理和重试逻辑的状态机。对于构建需要人工审批或长时间运行流程的可靠无服务器工作流的团队至关重要。
Architecture
Ambassador 模式架构图,本地代理边车处理身份验证头注入、熔断、重试逻辑和对外部第三方 API 出站请求的指标收集。该模板模拟 Ambassador 模式,与应用一起运行的辅助服务卸载外部通信的横切关注点。适合与需要弹性包装器的不可靠第三方服务集成的团队。
Architecture
微服务 API 网关架构图,展示请求路由、JWT 身份验证、速率限制、服务发现以及跨分布式后端服务的响应聚合。该模板模拟微服务生态系统中所有客户端流量的入口点,在请求到达内部服务之前执行安全策略。适合设计具有集中式横切关注点的可扩展 API 基础设施的平台工程师。