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?
- AConfigure 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.
- BCreate 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.
- 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
- DCreate 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
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