Volume 2 · Chapter 6 — AWS Networking Deep Dive (VPC)
DNS and Content Delivery: Route 53 and CloudFront
6.1 Introduction
Two services sit at the edge of every well-designed AWS system and shape how users reach it: Route 53, the DNS service that turns a domain name into the right address, and CloudFront, the content delivery network that serves content from locations near users. Together they determine the latency users experience, how traffic is routed across Regions, and how the system fails over when something breaks. They’re common interview topics because they connect networking to real user experience and to global resilience.
6.2 Route 53 and DNS
Route 53 is AWS’s managed Domain Name System service - it translates human-friendly domain names into the IP addresses or AWS resources that actually serve the request, and it does so from AWS’s global edge network so lookups are fast worldwide. Beyond basic name resolution, Route 53’s real power is its routing policies, which decidewhichanswer to return when a name could map to several targets. Simple routing returns one record. Latency-based routing returns the Region that will respond fastest for that user. Weighted routing splits traffic by percentage, which is ideal for gradual rollouts and A/B testing. Failover routing returns a healthy target and diverts away from an unhealthy one. Geolocation routing answers based on where the user is - useful for compliance or localized content. These policies turn DNS from a simple lookup into a traffic-management and resilience tool.
6.3 Health Checks and Failover
Route 53 can perform health checks against your endpoints and use the results in its routing. Combined with failover routing, this gives automatic Region-level failover: Route 53 continuously checks the primary endpoint’s health, and if it becomes unhealthy, DNS stops returning the primary and returns the standby instead, so users are directed to a healthy Region without manual intervention. This is a foundational piece of a multi-Region disaster-recovery design - the mechanism that actually shifts user traffic when a whole Region or application becomes unavailable. It’s worth noting DNS failover isn’t instantaneous (clients cache DNS answers for the record’s time-to-live), so TTLs are tuned to balance failover speed against lookup load.
flowchart TB
User((User)) --> R53{Route 53\nfailover + health checks}
R53 -->|primary healthy| PrimaryRegion[Primary Region endpoint]
R53 -.->|primary unhealthy| StandbyRegion[Standby Region endpoint]
R53 -->|latency-based| Nearest[Nearest/fastest Region] 6.4 CloudFront: The CDN
CloudFront is AWS’s content delivery network. It caches content at edge locations - the many points of presence near users - and serves it from the nearest edge rather than from the origin in the Region. When a user requests content, CloudFront serves it from the local edge if cached (a cache hit), dramatically reducing latency; only cache misses travel back to the origin. This does three things at once: it speeds up delivery by serving from nearby, it offloads traffic and load from the origin (fewer requests reach your servers and database), and it reduces data-transfer cost because content served from the edge cache doesn’t repeatedly leave the Region. CloudFront caches static assets naturally - images, scripts, styles, video - and can also cache API responses that are safe to cache.
6.5 Security at the Edge
CloudFront is also a security layer. Because user traffic hits CloudFront first, you attach a web application firewall (WAF) to it to filter malicious requests - SQL injection attempts, bad bots, abusive patterns - at the edge before they ever reach your application, and DDoS protection operates there too. CloudFront terminates TLS at the edge for encrypted delivery, and it can restrict access so that the origin only accepts traffic from CloudFront (not directly), keeping the origin private behind the CDN. For a bank, this edge tier is both a performance and a protection layer: attacks are absorbed and filtered at the edge, and the origin infrastructure is shielded.
6.6 Banking Production Scenario
A bank serves its web and mobile front ends through CloudFront: static assets and cacheable content are delivered from edge locations near each customer, so page loads are fast and the origin servers handle far less traffic. A WAF attached to CloudFront filters malicious requests at the edge, and the origin is configured to accept traffic only from CloudFront, so it’s shielded from direct internet access. Route 53 resolves the bank’s domain using latency-based routing so customers reach the nearest Region, and failover routing with health checks so that if the primary Region becomes unhealthy, traffic is automatically directed to the disaster-recovery Region. Together, Route 53 and CloudFront give the bank fast global delivery, automatic regional failover, and an edge security layer in front of everything.
6.7 Troubleshooting: Edge and DNS Issues
Edge-tier issues have common patterns. If users see stale content after a deploy, it’s CloudFront serving cached copies - the fix is a cache invalidation and appropriate cache-control settings and versioned asset names. If content isn’t being cached (every request hits the origin), the cache behaviour or cache-control headers are likely preventing caching. If failover seems slow, it’s usually DNS TTL caching - clients hold the old answer until the record’s TTL expires, so tuning TTL affects how quickly failover takes effect. If users reach the wrong Region, the routing policy or its health checks need review. And if the origin is receiving direct traffic that bypasses the CDN and WAF, the origin access restriction isn’t configured to require CloudFront. The diagnostic mindset is to separate DNS resolution issues (Route 53 policy, health checks, TTL) from caching and delivery issues (CloudFront cache behaviour, invalidation, origin access).
What does CloudFront do, and how does it improve performance, cost, and security together?
CloudFront is AWS’s content delivery network, and its core function is to cache content at edge locations - the many points of presence physically close to users - and serve it from the nearest edge rather than from the origin server back in the Region. When a user requests content, CloudFront checks its local edge cache; on a hit it serves immediately from nearby, and only on a miss does the request travel back to the origin. This one mechanism improves three things at once. Performance improves because content is served from a location near the user instead of a potentially distant Region, which dramatically cuts latency - the difference between a fast and a sluggish experience for a global user base. Cost improves in two ways: serving from the edge cache means fewer requests reach your origin servers and database, reducing the compute and database load you have to provision, and because cached content doesn’t repeatedly leave the Region, you reduce data-transfer (egress) charges. Security improves because CloudFront sits in front of your application as the entry point, so you attach a web application firewall to it to filter malicious requests - injection attempts, bad bots, abusive traffic - at the edge before they ever reach your application, DDoS protection operates at that edge tier, TLS is terminated there for encrypted delivery, and you can restrict the origin to accept traffic only from CloudFront so the origin stays shielded behind the CDN and can’t be hit directly. So CloudFront isn’t just a performance optimization; it’s simultaneously a latency reducer (serve from nearby), a load and cost reducer (offload the origin and cut egress), and a security layer (filter and absorb attacks at the edge while hiding the origin). For a bank, that means fast global delivery of its web and mobile front ends, far less load and cost on the origin, and an edge that filters attacks and shields the sensitive infrastructure behind it - which is why the CDN tier is a standard part of a well-architected, secure, performant system rather than an afterthought.
How do Route 53 routing policies and health checks support high availability and disaster recovery?
Route 53 is AWS’s managed DNS service, and beyond translating domain names to addresses, its routing policies and health checks turn DNS into an active traffic-management and resilience tool, which is central to high availability and disaster recovery. The routing policies decide which answer to return when a name could map to multiple targets. Latency-based routing returns the Region that will respond fastest for each user, so a global user base is automatically served from the nearest healthy Region - improving performance and spreading load across Regions. Weighted routing splits traffic by percentage, which supports gradual rollouts and controlled shifting of traffic between environments. Failover routing returns a designated primary target while it’s healthy and switches to a standby when the primary is not. Geolocation routing answers based on where the user is, useful for compliance and localized routing. Health checks are what make these dynamic: Route 53 continuously probes your endpoints, and it factors the results into its answers, so it only returns targets that are actually healthy. The combination of failover routing and health checks gives automatic Region-level failover for disaster recovery: Route 53 watches the primary Region’s health, and if the primary becomes unhealthy, DNS stops handing out the primary and returns the standby Region instead, so users are redirected to a healthy Region without any manual intervention - which is the mechanism that actually shifts user traffic during a Region-level outage. This is a foundational piece of a multi-Region DR design: the compute and data may be replicated to a second Region, but Route 53’s health checks and failover routing are what redirect real users there when needed. One caveat I’d mention is that DNS failover isn’t instantaneous because clients cache DNS answers for the record’s time-to-live, so TTLs are tuned to balance how fast failover propagates against DNS lookup load. So Route 53 supports HA and DR by routing users to the nearest healthy Region for performance and load distribution, and by using health checks with failover routing to automatically divert traffic away from an unhealthy primary to a standby - turning DNS into the control plane for global availability and regional recovery.
Chapter Revision Notes
- Route 53 is managed DNS from the global edge; its routing policies (simple, latency, weighted, failover, geolocation) manage traffic, not just resolve names.
- Health checks + failover routing give automatic Region-level failover for DR; DNS TTL caching affects failover speed.
- CloudFront caches content at edge locations, serving from nearby for lower latency, less origin load, and reduced egress cost.
- CloudFront is also an edge security layer: attach a WAF, absorb DDoS, terminate TLS, and restrict the origin to CloudFront-only.
- Diagnose DNS issues (policy, health checks, TTL) separately from caching/delivery issues (cache behaviour, invalidation, origin access).