Learning Objectives
- Understand cloud DNS services and routing policies
- Design DNS-based disaster recovery and failover
- Configure CDN caching and origin shielding
Cloud DNS Fundamentals
Every cloud provider offers a managed DNS service — Amazon Route 53, Azure DNS, Google Cloud DNS. These services translate domain names to IP addresses, support multiple routing policies, and integrate with other cloud services for health-based failover.
DNS Routing Policies
The choice of routing policy determines how traffic reaches your application:
Simple routing maps a domain to a single resource. Weighted routing distributes traffic across multiple endpoints by percentage — useful for canary deployments. Latency-based routing directs users to the region with the lowest latency for their location. Geolocation routing sends traffic based on the user's physical location — useful for regional content restrictions.
Match each DNS routing policy to its best use case.
Hints
- Some policies consider the user's location, others consider server health
- Think about traffic percentages vs absolute routing decisions
- One policy is specifically for blue-green deployments
DNS-Based Disaster Recovery
DNS health checks make disaster recovery automated. Route 53 monitors an endpoint every 30 seconds. When the primary endpoint fails, DNS automatically resolves to the secondary endpoint. This works well with active-passive architectures but requires careful TTL management — lower TTLs mean faster failover.
| Strategy | RTO | Cost | Complexity | |----------|-----|------|------------| | Active-passive DNS failover | Minutes | Low | Low | | Active-active with latency routing | Seconds | Medium | Medium | | Active-active with anycast (CDN) | Near-zero | High | High |
CDN Caching and Origin Shielding
A Content Delivery Network (CDN) like CloudFront, Azure CDN, or Cloud CDN caches content at edge locations close to users. Cache hit ratio is the percentage of requests served from the edge cache — a high ratio means lower origin load and faster responses.
Origin shielding adds an intermediate cache layer between the edge and the origin. Instead of every edge location fetching from the origin on a cache miss, the shield layer consolidates requests, reducing origin load significantly.
CDN Cache Hit Ratio
TTL Strategy
Short TTLs (60-300 seconds) mean faster propagation of changes but more DNS queries. Long TTLs (86400 seconds) reduce DNS costs but slow down failover. A common pattern is to use short TTLs for production critical records and long TTLs for static resources.
Which DNS routing policy would you use to implement blue-green deployments?
What is the primary benefit of origin shielding in a CDN?
Key Takeaways
- DNS routing policies control how traffic reaches your application globally
- Lower TTLs enable faster failover at the cost of more DNS queries
- Use weighted routing for canary and blue-green deployments
- CDN caching reduces latency and origin load — monitor cache hit ratio
- Origin shielding is essential for high-traffic applications with many edge locations