
Answer-first summary for fast verification
Answer: Implement Amazon ElastiCache to cache the large datasets.
## Explanation **Correct Answer: B - Implement Amazon ElastiCache to cache the large datasets.** ### Why this is the correct answer: 1. **Problem Analysis**: The scenario describes frequent calls to return **identical datasets** from the database, which is causing performance slowdowns. This is a classic caching problem where the same data is being repeatedly fetched from the database. 2. **Amazon ElastiCache Solution**: - ElastiCache is a fully managed in-memory caching service that supports Redis and Memcached. - It's specifically designed to cache frequently accessed data to reduce database load and improve application performance. - By caching the identical datasets in memory, subsequent requests can be served from the cache instead of querying the RDS database. 3. **Why other options are incorrect**: - **A. Amazon SNS**: SNS is a pub/sub messaging service, not designed for caching. It doesn't store database calls or cache data. - **C. RDS read replica**: While read replicas can help with read scaling, they don't "cache" database calls. They replicate data for read operations but still require database queries. This would add complexity without solving the core caching problem. - **D. Kinesis Data Firehose**: This is for streaming data to destinations like S3, Redshift, or Elasticsearch, not for caching or improving database query performance. ### Key Benefits of ElastiCache: - **Reduced Database Load**: Offloads repetitive queries from RDS - **Faster Response Times**: In-memory access is much faster than disk-based database queries - **Scalability**: Can handle high volumes of cache requests - **Managed Service**: AWS handles maintenance, patching, and scaling ### Implementation Approach: 1. Identify the frequently accessed, identical datasets 2. Configure ElastiCache (Redis or Memcached) in the same VPC as the backend EC2 instances 3. Modify the backend application to: - Check cache first for requested data - If cache miss, query RDS and store result in cache - Set appropriate TTL (Time To Live) for cached data 4. Monitor cache hit rates and adjust as needed This solution directly addresses the performance issue caused by repeated identical database queries.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
An ecommerce company is running a multi-tier application on AWS. The front-end and backend tiers both run on Amazon EC2, and the database runs on Amazon RDS for MySQL. The backend tier communicates with the RDS instance. There are frequent calls to return identical datasets from the database that are causing performance slowdowns.
Which action should be taken to improve the performance of the backend?
A
Implement Amazon SNS to store the database calls.
B
Implement Amazon ElastiCache to cache the large datasets.
C
Implement an RDS for MySQL read replica to cache database calls.
D
Implement Amazon Kinesis Data Firehose to stream the calls to the database.