SAA-C03 Question 472
Single answerAn e-commerce company is using an Amazon EC2 instance to host their application. During peak holiday seasons, the traffic to their website increases significantly, causing performance issues. The company wants a cost-effective solution to handle these traffic spikes automatically and scale down during off-peak hours. Additionally, they want to avoid losing in-memory session data when instances are terminated. Which solution best addresses this requirement?
- A
Use Auto Scaling with a launch configuration and enable instance hibernation.
- B
Use Auto Scaling with a launch template and Amazon Elastic Load Balancer (ELB) to distribute traffic.
- C
Use an Amazon EC2 instance with an EBS-backed root volume and manually scale the instance type during peak times.
- D
Use AWS Lambda functions to replace the EC2 instance and handle varying traffic.
Show answer and explanation
Correct answer: B
Explanation
The correct answer is to use Auto Scaling with a launch template and an Amazon Elastic Load Balancer (ELB). Auto Scaling allows the application to automatically increase or decrease the number of EC2 instances based on demand, ensuring cost efficiency and high availability. ELB ensures that traffic is distributed evenly across instances, providing better performance during high traffic periods. Hibernation is not suitable for Auto Scaling, as it is used for different use cases, like quickly resuming long-running instances.
- A. Incorrect.
Instance hibernation is not compatible with Auto Scaling. Hibernation is used for retaining memory (RAM) state of instances but is not designed for handling scaling scenarios with Auto Scaling.
- B. Correct.
This option uses Auto Scaling to dynamically adjust the number of EC2 instances based on demand and an ELB to distribute traffic, ensuring high availability and scalability. It is a cost-effective and automated solution for handling traffic spikes.
- C. Incorrect.
Manually scaling the instance type is inefficient and does not provide real-time response to traffic spikes. This method also leads to increased administrative overhead.
- D. Incorrect.
AWS Lambda is a serverless compute service, but it might not be suitable for hosting stateful applications or for applications that require session persistence. The question specifies scaling an EC2-based application, making this option less relevant.