DNS and Content Delivery
Amazon Route 53 and Amazon CloudFront
1. Amazon Route 53
Amazon Route 53 is a highly available and scalable cloud Domain Name System (DNS) web service. It translates domain names (like www.example.com) into numeric IP addresses (like 192.0.2.1) that computers use to connect to each other.
Key Features
- Fully compliant with IPv4 and IPv6.
- Domain name registration: Purchase and manage domain names directly through Route 53.
- Health checks: Monitor the health of resources and route traffic to healthy endpoints.
- Traffic flow: Visual editor to manage global routing with DNS failover for low-latency, fault-tolerant architectures.
Routing Policies
| Policy | Use When |
|---|---|
| Simple routing | Single resource performing a function (e.g., one web server). |
| Weighted routing | Route traffic to multiple resources in proportions you specify (e.g., A/B testing: 75% to version A, 25% to version B). |
| Latency routing | Route to the Region providing the best (lowest) latency based on performance measurements. |
| Geolocation routing | Route based on the geographic location of users (localize content, restrict distribution). |
| Geoproximity routing | Route based on the location of resources, with optional bias to shift traffic between locations. |
| Failover routing | Active-passive failover. Route 53 monitors the primary site and fails over to a backup if it becomes unhealthy. |
| Multivalue answer | Respond with up to 8 healthy records selected at random. Not a load balancer substitute but adds availability. |
DNS Failover in Action
A common pattern: primary record points to an ELB in front of EC2 instances. Secondary record points to a static S3 website. Route 53 health checks monitor the primary. If it fails, traffic automatically fails over to the S3 backup site.
2. Amazon CloudFront
Amazon CloudFront is a fast content delivery network (CDN) service that securely delivers data, videos, applications, and APIs to customers globally with low latency and high transfer speeds.
Infrastructure
- Edge locations: Worldwide network of data centers that serve popular content quickly.
- Regional edge caches: Larger caches between origin servers and edge locations. Hold content that is not popular enough to stay at edge locations, reducing trips to the origin.
Benefits
| Benefit | Description |
|---|---|
| Fast and global | Massively scaled global network of edge locations and regional caches. |
| Security at the edge | Built-in AWS Shield Standard, custom SSL via AWS Certificate Manager at no extra cost. |
| Highly programmable | Lambda@Edge runs custom code at AWS locations worldwide, closer to users. |
| Integrated with AWS | Directly connected to AWS Global Infrastructure. Works with S3, ELB, EC2, and Lambda. |
| Cost-effective | Pay-as-you-go, no minimum commitments. Data transfer from S3/ELB to CloudFront is free. |
Route 53 vs. CloudFront
Need to resolve domain names to IP addresses and route users based on geography or latency? → Amazon Route 53 (DNS).
Need to cache and deliver content from the nearest edge location to reduce latency? → Amazon CloudFront (CDN).
Need both? Use them together — Route 53 directs users to the best endpoint, and CloudFront caches content at the edge.
3. Quick Quiz
Test Your Understanding
Select one answer per question. You will receive immediate feedback.