Question #903
A live-events company is designing a scaling solution for its ticket application on AWS. The application experiences sudden traffic surges during scheduled sale events. The application runs on EC2 instances in an Auto Scaling group and uses a PostgreSQL database. The company needs a solution that ensures high availability during these events.
Which solution meets these requirements?
Use a predictive scaling policy for EC2. Deploy the database on Amazon RDS for PostgreSQL Multi-AZ with read replicas that auto-scale. Use AWS Step Functions with Lambda to pre-warm the database. Trigger this with an EventBridge rule.
Use scheduled scaling for EC2. Use Amazon Aurora PostgreSQL Multi-AZ with read replicas. Create EventBridge rules to trigger Lambda functions that increase read replica capacity before the event and decrease it after, including a failover to the larger replica.
Apply predictive scaling to EC2. Host the database on Aurora Serverless v2 Multi-AZ, which scales automatically. Use EventBridge to trigger Lambda functions that pre-warm the database.
Use scheduled scaling for EC2. Deploy the database on RDS PostgreSQL Multi-AZ with read replicas. Use EventBridge to invoke Lambda functions that scale up the replica before the event and scale down after, including a failover.
Explanation
Option B is correct because:
1. Scheduled Scaling for EC2: Traffic surges are predictable (scheduled sale events), so scheduled scaling ensures EC2 instances are ready before the event.
2. Aurora PostgreSQL Multi-AZ: Provides high availability with automatic failover. Aurora read replicas scale more efficiently than RDS PostgreSQL.
3. EventBridge & Lambda: Automatically increase read replica capacity before events and decrease afterward, aligning database resources with traffic demands.
Other options fail because:
- A: RDS read replicas cannot auto-scale; pre-warming is unnecessary if scaling is properly managed.
- C: Aurora Serverless v2 scales automatically, but scheduled scaling for EC2 is more reliable for predictable traffic than predictive scaling.
- D: RDS PostgreSQL requires manual read replica scaling, which is slower and less efficient than Aurora's approach.
Key Points:
- Use scheduled scaling for predictable traffic spikes.
- Aurora Multi-AZ + read replicas ensure high availability and scalability.
- Automate scaling actions with EventBridge and Lambda.
Answer
The correct answer is: B