Question

Difficulty: MediumEdge Caching and Content Delivery for Resilient Architectures

A news agency hosts a dynamic web application on Amazon EC2 instances behind an Application Load Balancer (ALB). During breaking news events, traffic spikes significantly, occasionally causing backend database exhaustion and HTTP 503 Service Unavailable errors. The agency has created a static backup site in an Amazon S3 bucket. A solutions architect must design a highly resilient caching solution that automatically serves this static backup content globally with the lowest latency when the primary ALB is unavailable or failing. Which solution meets these requirements with the least operational complexity?

  1. Configure an Amazon CloudFront distribution with an origin group containing the ALB as the primary origin and the S3 bucket as the secondary origin. Set the origin group to fail over to the S3 bucket on 500, 502, 503, and 504 HTTP status codes.Answer
  2. B
    Configure an Amazon Route 53 failover routing policy with health checks, directing traffic to the ALB as the primary endpoint and to the S3 bucket configured for static website hosting as the secondary endpoint.
  3. C
    Deploy AWS WAF in front of the ALB. Configure a custom Web ACL rule to intercept HTTP 503 error codes from the ALB and redirect the user's web browser to the backup S3 bucket URL.
  4. D
    Set up an Amazon CloudFront distribution with the ALB as the origin. Configure the default cache behavior with a Time to Live (TTL) of zero so that all requests are forwarded directly to the origin, allowing Route 53 to handle the failover routing.

Answer

Configure an Amazon CloudFront distribution with an origin group containing the Application Load Balancer as the primary origin and the S3 bucket as the secondary origin, setting failover status codes to redirect traffic to the S3 bucket.
The correct solution uses an Amazon CloudFront origin group. By setting the Application Load Balancer as the primary origin and the Amazon S3 bucket as the secondary origin, CloudFront automatically catches HTTP server errors (such as 503 Service Unavailable) at the edge and routes requests to the backup S3 bucket. This provides automatic failover with minimal latency, leverages edge caching, and avoids client-side DNS propagation delays.

Step-by-Step Solution

1
Identify the resilience and latency requirements.
The solution requires dynamic edge caching to minimize latency globally and automatic failover during origin outages without relying on slow DNS changes.
CloudFront distributions provide global edge caching, and CloudFront origin groups support active-passive origin failover.
2
Configure the CloudFront Origin Group.
An origin group is created with the Application Load Balancer as the primary origin and the Amazon S3 bucket as the secondary origin.
This allows CloudFront to fallback to the secondary origin if the primary origin is unreachable or returns error codes.
3
Define failover criteria based on HTTP response status codes.
CloudFront is configured to fail over when the primary origin returns 500, 502, 503, or 504 status codes.
This captures backend failures and database connection exhaustion issues immediately and serves static placeholder pages from the S3 bucket.

Key Concept

CloudFront Origin Groups allow solutions architects to configure origin failover for high availability and resilient content delivery.
Estimated Time:1m 30s
Rate this question