What should a solutions architect recommend to ensure that all the requests are processed successfully?
Add an Amazon CloudFront distribution for the dynamic content. Increase the number of EC2 instances to handle the increase in traffic.
Add an Amazon CloudFront distribution for the static content. Place the EC2 instances in an Auto Scaling group to launch new instances based on network traffic.
Add an Amazon CloudFront distribution for the dynamic content. Add an Amazon ElastiCache instance in front of the ALB to reduce traffic for the API to handle.
Add an Amazon CloudFront distribution for the static content. Add an Amazon Simple Queue Service (Amazon SQS) queue to receive requests from the website for later processing by the EC2 instances.
Explanations:
While adding CloudFront for dynamic content can improve performance, it doesn’t address the core issue of handling a sudden surge in salesrequests. Simply increasing the number of EC2 instances is a form of manual scaling, which is not ideal for sudden spikes.
Adding CloudFront for static content is a good practice for caching, but it doesn’t directly address the handling of sales requests. Placing EC2 instances in an Auto Scaling group based onnetwork trafficis not the most effective metric for scaling the API tier based on the number ofrequests. CPU utilization or request count are more relevant metrics.
Adding CloudFront for dynamic content and ElastiCache can improve performance, but it still doesn’t prevent requests from being lost if the API tier becomes overloaded. ElastiCache primarily caches data, not requests. If the API cannot handle the incoming requests, caching will not prevent errors.
Adding CloudFront for static content improves performance by caching static assets. Using SQS to decouple the website from the API provides a buffer for incoming sales requests. This ensures that no requests are lost, even during sudden spikes. The EC2 instances can then process the requests from the queue at their own pace. This is the best approach for handling a surge in requests and ensuring successful processing.