Soru

Zorluk: OrtaEdge Caching and Content Delivery for Resilient Architectures

A medical research institute distributes large, static genomic data files that are updated weekly, and provides a search API for genomic metadata. The genomic files are stored in an Amazon S3 bucket, and the search API is hosted on Amazon EC2 instances behind an Application Load Balancer (ALB). During new publication releases, the institute experiences sudden spikes in global traffic. The institute needs a resilient architecture that minimizes load on both S3 and the ALB, reduces latency for researchers worldwide, and protects the search API from SQL injection attacks. Which architecture meets these requirements with the lowest latency and highest resiliency?

  1. A
    Configure Amazon Route 53 with latency-based routing policies to distribute traffic directly to the S3 bucket for static files and to the ALB for API requests. Associate an AWS WAF web ACL with the ALB to mitigate SQL injection attacks.
  2. B
    Create an Amazon CloudFront distribution with the S3 bucket and ALB configured as origins. Configure cache behaviors to cache static files and forward API requests. Enable AWS Shield Advanced on the CloudFront distribution to detect and block SQL injection attacks on the API.
  3. Create an Amazon CloudFront distribution with the S3 bucket and ALB configured as origins. Configure two cache behaviors: one for static file paths with caching enabled, and one for API paths that forwards requests to the ALB. Associate an AWS WAF web ACL with the CloudFront distribution.Cevap
  4. D
    Create an Amazon CloudFront distribution with the S3 bucket and ALB configured as origins. Configure a cache behavior for the static files with Minimum TTL, Default TTL, and Maximum TTL set to 0 to ensure the weekly files are never stale. Associate an AWS WAF web ACL with the CloudFront distribution.

Cevap

Create an Amazon CloudFront distribution with the S3 bucket and ALB configured as origins. Configure two cache behaviors: one for static file paths with caching enabled, and one for API paths that forwards requests to the ALB. Associate an AWS WAF web ACL with the CloudFront distribution.
The correct solution uses Amazon CloudFront to cache static files from S3 at edge locations, significantly reducing global latency and origin S3 read load during traffic spikes. Dynamic API requests are routed through a separate CloudFront cache behavior to the ALB without caching. By attaching an AWS WAF web ACL to CloudFront, the API is protected against SQL injection attacks at the edge, before the traffic reaches the backend servers.

Adım Adım Çözüm

1
Analyze the static and dynamic requirements.
The static genomic data files stored in S3 can be cached at the edge, while the dynamic search API requests behind the ALB should be forwarded to the origin without caching.
Separating static and dynamic traffic allows for optimized caching rules and reduces load on the origin S3 bucket and ALB.
2
Configure Amazon CloudFront origins and cache behaviors.
Create a CloudFront distribution with the S3 bucket and ALB as origins. Create a behavior for `/static/*` that caches content, and a behavior for `/api/*` that forwards requests to the ALB origin with caching disabled.
CloudFront edge locations serve cached static content directly to users, minimizing latency and origin load, while acting as a reverse proxy for the API traffic.
3
Address the security requirement for the search API.
Associate an AWS WAF web ACL with the CloudFront distribution to inspect incoming requests for SQL injection signatures.
AWS WAF provides Layer 7 protection at the edge, blocking malicious requests before they reach the ALB or S3 origins.

Anahtar Kavram

Using Amazon CloudFront cache behaviors to segregate and optimize static caching and dynamic forwarding, combined with AWS WAF for Layer 7 edge security.
Tahmini Süre:2m 0s
Bu soruyu puanla