Q94 — AWS DVA-C02 Ch.3
Question 94 of 100 | ← Chapter 3
An application consists of two tiers: one for web services and one for databases. The web tier serves web pages and manages session state in memory. The database tier hosts a MySQL database containing order details. During high-traffic periods, the web tier’s memory utilization approaches 100%, and application performance degrades significantly. Developers identify that much of the increased memory usage and potential slowdown stems from managing session state for additional users. For migrating the web tier, developers plan to use Amazon EC2 instances behind an Application Load Balancer with Auto Scaling. What additional changes should developers make to the application to improve scalability?
- A. Host the MySQL database on EC2 instances. Store both session data and application data in the MySQL database.
- B. Use Amazon ElastiCache for Memcached to store and manage session data. Use an Amazon RDS for MySQL DB instance to store application data. ✓
- C. Use Amazon ElastiCache for Memcached to store and manage both session data and application data.
- D. Use EC2 instance storage to manage session data. Use an Amazon RDS for MySQL DB instance to store application data.
Correct Answer: B. Use Amazon ElastiCache for Memcached to store and manage session data. Use an Amazon RDS for MySQL DB instance to store application data.
Explanation
Option B is correct. Storing session data in Amazon ElastiCache for Memcached offloads memory-intensive session management from EC2 instances, directly addressing the root cause of near-100% memory utilization. Memcached is optimized for low-latency, in-memory session caching. Meanwhile, Amazon RDS for MySQL provides managed, durable, and scalable persistent storage for structured application data like order details—unlike Memcached, which is ephemeral and unsuitable for persistent data. Option A centralizes all data in MySQL, increasing latency and failing to relieve memory pressure. Option C misuses Memcached for persistent data, risking data loss. Option D lacks durability, scalability, and operational efficiency compared to managed ElastiCache. Thus, B delivers optimal scalability, reliability, and maintainability.