Soru

Zorluk: ZorImproving Database and Caching Efficiency

A software-as-a-service (SaaS) company hosts a multi-tenant talent management platform on AWS. The application backend runs on AWS Fargate containers behind an Application Load Balancer, and uses an Amazon Aurora Serverless v2 PostgreSQL DB cluster as its primary database. During the annual performance review cycle, the platform experiences a massive, predictable surge in read traffic (exceeding 100,000100,000 queries per second) as users retrieve employee competency profiles. This traffic spike causes the Aurora Serverless v2 DB cluster to scale up to its maximum capacity, resulting in high database CPU utilization (above 90%90\%), increased latency, and significantly higher operational costs. The profiles are updated infrequently but must be retrieved with sub-millisecond latency. The solutions architect must implement a caching solution that is highly available, supports automatic failover, and protects the database from cache-stampede issues if a cache node fails.

Which strategy should the solutions architect implement to resolve these issues?

  1. Deploy an Amazon ElastiCache for Redis replication group in a Multi-AZ configuration with automatic failover enabled, and configure the application to use a cache-aside pattern to read and write profile data.Cevap
  2. B
    Deploy an Amazon ElastiCache for Memcached cluster with nodes distributed across multiple Availability Zones, and configure the application to cache the profile data using Auto Discovery.
  3. C
    Configure a Multi-AZ deployment for the database cluster to enable a standby instance in a second Availability Zone, and redirect all profile read queries to the standby instance's endpoint to offload the primary database instance.
  4. D
    Purchase EC2 Instance Savings Plans to apply discounts to the scaled-up Aurora Serverless v2 and AWS Fargate application container instances, and implement a local, in-memory cache on each application container.

Cevap

Deploy an Amazon ElastiCache for Redis replication group in a Multi-AZ configuration with automatic failover enabled, and configure the application to use a cache-aside pattern to read and write profile data.
The correct strategy is to deploy Amazon ElastiCache for Redis in a Multi-AZ configuration. ElastiCache for Redis provides key-value caching with sub-millisecond response times, replication across availability zones, and automatic failover. Utilizing a cache-aside pattern offloads read requests from the primary database cluster, keeping CPU utilization low, preventing expensive scaling of the Aurora Serverless v2 instances, and protecting the database from cache-stampede issues during node failures.

Adım Adım Çözüm

1
Identify the caching tier requirements.
The requirements include sub-millisecond read latency, high availability, automatic failover, protection against cache-stampede, and cost control for the underlying database.
This establishes the technical criteria to evaluate potential caching technologies and deployment architectures.
2
Evaluate Amazon ElastiCache engines.
ElastiCache for Redis is selected because it supports replication, multi-AZ deployment with automatic failover, and data persistence. ElastiCache for Memcached is disqualified because it lacks replication and failover features, leaving the database vulnerable to cache-stampede on node failure.
Choosing the correct caching engine ensures compliance with high availability and resilience requirements.
3
Analyze database offloading and cost-saving methods.
A centralized caching tier using a cache-aside pattern handles the read workload outside the database. Directing reads to Multi-AZ standbys is not possible, and local in-memory caching on container instances introduces data inconsistency. EC2 Instance Savings Plans cannot reduce costs for Aurora Serverless or AWS Fargate.
This rules out sub-optimal or non-viable architectural designs for database read-scaling and cost optimization.

Anahtar Kavram

Improving Database and Caching Efficiency

Alternatif Yöntem

For static or semi-static data, Amazon CloudFront could potentially be used to cache responses at the edge if API endpoints return cache-control headers, but this does not address internal query caching needs directly or protect the database from application-tier stampedes as effectively as ElastiCache.
Tahmini Süre:2m 30s
Bu soruyu puanla