A financial services company hosts a high-frequency trading dashboard on Amazon EC2 instances located in private subnets of a VPC. The application performs millions of read queries per second against an Amazon DynamoDB table containing real-time stock market ticker symbols. The dashboard requires sub-millisecond response times for read operations. During peak market hours, read throughput spikes dramatically, causing DynamoDB throttling and increased latency. The solutions architect must design a high-performing and cost-effective caching solution to solve this performance bottleneck. Which architecture will meet these requirements with the lowest latency and optimal cost-efficiency?
- ADeploy an Amazon CloudFront distribution in front of an Application Load Balancer that routes requests to the EC2 instances. To ensure the dashboard always displays real-time stock ticker data, configure the CloudFront cache behavior with a Minimum TTL, Maximum TTL, and Default TTL of 0 seconds.
- BImplement an application-level caching mechanism that writes queried ticker data as temporary JSON files to an Amazon S3 bucket. Configure the S3 bucket to use the Amazon S3 Standard-Infrequent Access (S3 Standard-IA) storage class, and use an S3 Lifecycle rule to expire objects after 24 hours.
- Provision an Amazon DynamoDB Accelerator (DAX) cluster in the VPC subnets where the EC2 instances reside. Update the application configuration to use the DAX client SDK to query the DAX cluster endpoint instead of the database table directly.Cevap
- DConfigure the application on the EC2 instances to write query responses to an Amazon S3 bucket. Access the cached data via S3 GET requests routed through a NAT Gateway in the public subnet to bypass DynamoDB read capacity limits.
Cevap
Provision an Amazon DynamoDB Accelerator (DAX) cluster in the VPC subnets where the EC2 instances reside. Update the application configuration to use the DAX client SDK to query the DAX cluster endpoint instead of the database table directly.
Amazon DynamoDB Accelerator (DAX) is an in-memory, fully managed write-through cache designed specifically for Amazon DynamoDB. It reduces read response times to microseconds (sub-millisecond) and offloads read capacity requirements from the database table. Because it runs inside the VPC and integrates transparently via the DAX SDK, it is the most performant and cost-effective solution for read-heavy stock ticker workloads.
Adım Adım Çözüm
Anahtar Kavram
Selecting the optimal caching layer to accelerate database queries and minimize operational costs under high throughput
Alternatif Yöntem
Alternatively, if the application was built on a relational database like Amazon RDS, Amazon ElastiCache (Redis OSS or Memcached) could be used to cache query results at the application layer, though it requires custom cache invalidation logic compared to the seamless integration of DAX with DynamoDB.
Tahmini Süre:3m 0s