Intelligent failover using AWS Lambda@Edge and Amazon DynamoDB
Networking & Content Delivery Blog
This article describes a serverless solution using AWS Lambda@Edge and Amazon DynamoDB to intelligently route user traffic across multiple AWS regions with session affinity and automatic failover capabilities.
- Lambda@Edge runs custom routing logic at 13 Regional Edge Cache locations to dynamically assign users to specific regions based on session IDs
- DynamoDB stores endpoint configurations and user-session mappings, with Global Tables enabling multi-region replication for resilience
- Solution handles regional outages gracefully by evacuating users from impaired regions and redistributing them to healthy endpoints
- Operates on the data plane after setup, avoiding control plane bottlenecks and enabling millisecond-level failover decisions
- Ideal for applications requiring session affinity, A/B testing, cell-based architectures, and high availability in e-commerce, finance, and healthcare
- Open-source implementation available via AWS CDK for easy deployment
This architecture provides a cost-effective, scalable foundation for mission-critical applications requiring resilient multi-region traffic management with minimal operational complexity.
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
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.