CloudFront vs ALB
Compare global CDN edge delivery with regional application load balancing.
Networking
Amazon CloudFront
CloudFront is AWS’s CDN and edge delivery service. It caches content globally and reduces latency by serving users from edge locations close to them.
Networking
Application Load Balancer
ALB is a regional Layer 7 load balancer that routes HTTP and HTTPS traffic to backend targets such as EC2, ECS services, or Lambda functions.
Key Differences
CloudFront is a CDN and edge caching layer, while ALB is a regional application load balancer.
CloudFront improves global content delivery and caching, while ALB distributes application traffic to backend services.
CloudFront is designed to reduce latency and offload origin traffic, while ALB is designed to route requests intelligently within a region.
CloudFront often sits in front of origins such as S3, ALB, or API endpoints, while ALB typically sits in front of application backends.
ALB is not a CDN, and CloudFront is not a replacement for backend load balancing.
The core difference is edge delivery versus application traffic routing.
When to Use
When to use CloudFront
Use CloudFront for global caching, lower-latency content delivery, edge protection patterns, and reducing load on backend origins.
When to use ALB
Use ALB when you need Layer 7 routing to backend services such as EC2, ECS, or Lambda within an AWS region.
Tradeoffs
CloudFront improves performance and edge distribution, but does not replace backend request routing logic.
ALB is excellent for app routing, but does not solve global edge caching or CDN concerns by itself.
Together they often provide a stronger architecture than either component alone.
Common Mistakes
Thinking CloudFront replaces ALB entirely for backend application routing.
Using only ALB in global delivery scenarios where edge caching matters a lot.
Treating CDN and load balancing as the same architectural layer.
Interview Tip
A clean short answer is: CloudFront is edge delivery, ALB is backend application routing.