A company hosts a financial reporting application on AWS. The application uses Amazon EC2 instances behind an Application Load Balancer (ALB) to query an Amazon RDS for PostgreSQL database. Users run complex, repetitive SQL queries that retrieve historical transaction records. During month-end reporting cycles, the database CPU utilization reaches , leading to query timeouts and slow response times. The database records are updated only once per day. Which architectural solution should a solutions architect implement to resolve the database bottleneck with the lowest latency?
- AConfigure an Amazon CloudFront distribution in front of the Application Load Balancer, and set the cache behavior minimum, maximum, and default TTLs to on the API path.
- BMigrate the transaction tables to Amazon DynamoDB in Provisioned Capacity Mode, designing the primary partition key with a monotonically increasing timestamp.
- Deploy an Amazon ElastiCache for Redis cluster. Configure the application to implement a cache-aside pattern to check the cache before querying the database, and write query results to the cache.Cevap
- DAttach an Amazon Elastic File System (Amazon EFS) volume using General Purpose performance mode to the RDS database instance to share cached query runs.
Cevap
Deploy an Amazon ElastiCache for Redis cluster, and configure the application to check the cache before querying the database, writing query results to the cache (cache-aside pattern).
The correct answer provides an in-memory caching layer (Amazon ElastiCache for Redis) directly in front of the RDS database. Implementing the cache-aside pattern ensures that repetitive, resource-intensive queries are served from memory with sub-millisecond latency. This completely offloads the database from processing redundant queries, resolving the CPU utilization bottleneck.
Adım Adım Çözüm
Anahtar Kavram
Database query caching using ElastiCache to offload complex relational query execution from Amazon RDS.