Home icon

Multi-region disaster recovery for Amazon API Gateway WebSocket APIs

Architecture Blog



This article presents a multi-region disaster recovery pattern for Amazon API Gateway WebSocket APIs that automatically reconnects clients and restores state during regional failover.

  • Active-passive architecture with primary and secondary regions sharing state via DynamoDB Global Tables
  • Route 53 failover routing detects regional failures and redirects traffic automatically
  • Canary health probe opens WebSocket connections every minute to detect failures independently
  • CloudWatch alarms trigger Route 53 health check updates after two consecutive probe failures
  • Client-side exponential backoff with jitter prevents thundering herd during reconnection
  • Clients restore application state by sending getState message after reconnecting to secondary region
  • Heartbeat mechanism (30-second interval, 35-second timeout) monitors connection health
  • Demo auction application shows real-time state synchronization across regions during failover

This pattern enables seamless failover for real-time applications like trading platforms, collaborative editors, and gaming leaderboards by separating application state from WebSocket connections.



Go to article

The AWS News Feed is currently looking for gold sponsors. If you want to support the AWS community and reach a large audience of AWS professionals, consider sponsoring the AWS News Feed.

Related articles

Jul 8
2024
Implementing multi-Region failover for Amazon API Gateway
Aug 8
2025
Cross-Region disaster recovery using AWS Elastic Disaster Recovery
Aug 3
2026
Amazon Redshift multi-Region disaster recovery
Aug 1
2025
Introducing Amazon Application Recovery Controller Region switch: A multi-Region application recovery service

The AWS News Feed is currently looking for silver sponsors. If you want to support the AWS community and reach a large audience of AWS professionals, consider sponsoring the AWS News Feed.