3.2.2. Route 53 Health Checks and Routing Policies
š” First Principle: DNS is the first decision point for traffic routing ā before a packet ever reaches your load balancer or application. Route 53 routing policies let you make sophisticated traffic routing decisions at the DNS layer: route to the fastest endpoint, route to a backup if the primary fails, or distribute traffic across regions. This is global load balancing without a load balancer.
Route 53 health checks are independent of ELB health checks ā they check endpoints from multiple AWS locations globally, making them useful for detecting regional failures that an in-region health check would miss.
Health Check Types:
| Type | What It Monitors |
|---|---|
| Endpoint | HTTP/HTTPS/TCP check on a specific IP or domain |
| Calculated | Combines results of other health checks (AND/OR logic) |
| CloudWatch Alarm | Marks healthy/unhealthy based on CloudWatch alarm state |
Routing Policies ā The Complete Set:
| Policy | How It Routes | Use Case |
|---|---|---|
| Simple | Single record, no health check integration | Single resource, basic use |
| Weighted | Distributes traffic by weight (e.g., 80%/20%) | A/B testing, gradual migrations, blue/green |
| Latency | Routes to the region with lowest measured latency for the client | Global apps optimizing for speed |
| Failover | Primary ā Secondary when primary health check fails | Active-passive disaster recovery |
| Geolocation | Routes based on client's geographic location | Compliance (EU data in EU), localization |
| Geoproximity | Routes based on proximity with optional bias | Fine-grained traffic shifting between regions |
| Multivalue Answer | Returns multiple healthy IP addresses (up to 8) | Client-side load balancing with health checking |
| IP-based | Routes based on client's IP CIDR range | ISP-specific routing, compliance |
Failover Routing: This is the canonical active-passive pattern:
For failover to work, the primary record must have a health check. Route 53 monitors the primary endpoint; if the health check fails, DNS responses automatically point to the secondary record. TTL determines how long clients cache the old response ā lower TTL means faster failover but more DNS queries.
Alias Records: A Route 53 feature that lets you point a DNS record directly to an AWS resource (ALB, CloudFront distribution, S3 static website, another Route 53 record) without using a CNAME. Alias records work at the zone apex (e.g., example.com) where CNAMEs are not allowed, and there's no extra charge for alias record queries.
ā ļø Exam Trap: Geolocation routing routes based on where the user is ā not where the latency is lowest. Geolocation is for compliance and content localization. If the question says "route users to the fastest endpoint," the answer is Latency routing, not Geolocation. If it says "EU users must be served from EU infrastructure for GDPR," the answer is Geolocation routing.
Reflection Question: A SaaS company has infrastructure in us-east-1 (primary) and eu-west-1 (secondary). They want automatic DNS failover, but they also need European users to always be served from eu-west-1 for data residency reasons. Which combination of Route 53 routing policies accomplishes both requirements?