#Availability Patterns
Patterns for high availability systems.
#Key Patterns
#Health Endpoint Monitoring
yaml
1# Kubernetes probe
2livenessProbe:
3 httpGet:
4 path: /health
5 port: 8080
6 initialDelaySeconds: 5#Circuit Breaker
diagram
[Client] ──▶ [Circuit Breaker] ──▶ [Service]
│
└── Opens on failures
Prevents cascade#Retry with Backoff
python
1import time
2
3def retry_with_backoff(func, max_retries=3):
4 for attempt in range(max_retries):
5 try:
6 return func()
7 except Exception:
8 time.sleep(2 ** attempt)
9 raise Exception("Max retries exceeded")#Multi-Region
- Active-Active: Both regions serve traffic
- Active-Passive: Standby for failover
- Pilot Light: Minimal standby, scale on failover
[!TIP] Pro Tip: Design for failure - everything fails eventually!