Soru

Zorluk: OrtaHigh-Performing Database Solutions

A company is designing a high-performance web application to track user activity logs. The application must write up to 10,00010,000 events per second, with each event payload containing a user ID, a timestamp, and action details. The read queries will be highly spiky and unpredictable, requiring sub-millisecond latency to display user dashboards. A solutions architect is designing the Amazon DynamoDB table for this workload. Which database configuration will provide the highest performance and efficiency?

  1. A
    Configure the DynamoDB table with a partition key of `user_id` and a sort key of `timestamp`. Set the table capacity to Provisioned mode with static capacity limits, and use Amazon ElastiCache for Memcached to cache read queries.
  2. B
    Configure the DynamoDB table with a partition key of `timestamp` formatted as `YYYY-MM-DD-HH` and a sort key of `user_id`. Set the table capacity to Provisioned mode with auto scaling enabled.
  3. Configure the DynamoDB table with a partition key of `user_id` and a sort key of `timestamp`. Set the table capacity to On-Demand mode, and deploy Amazon DynamoDB Accelerator (DAX) to cache read queries.Cevap
  4. D
    Configure an Amazon RDS for PostgreSQL database with a primary instance and multiple Read Replicas. Configure the application to write to the primary instance and route read queries to the Read Replicas, using the replicas as automatic failover targets.

Cevap

Configure the DynamoDB table with a partition key of `user_id` and a sort key of `timestamp`. Set the table capacity to On-Demand mode, and deploy Amazon DynamoDB Accelerator (DAX) to cache read queries.
The correct configuration uses a high-cardinality partition key (`user_id`) combined with a sort key (`timestamp`) to distribute writes evenly across multiple partitions. Utilizing On-Demand capacity mode allows DynamoDB to handle unpredictable and spiky read and write traffic without throttling or manual capacity planning. Amazon DynamoDB Accelerator (DAX) provides the required sub-millisecond latency for read operations by caching query results in-memory.

Adım Adım Çözüm

1
Evaluate the ingestion throughput and latency constraints.
The application requires high write throughput of 10,00010,000 writes per second and sub-millisecond read latency under spiky load, pointing to a NoSQL solution like Amazon DynamoDB with an in-memory cache.
Choosing the correct database engine type is the foundation of high-performance architecture design.
2
Determine the partition key design to prevent bottlenecks.
Using `user_id` as the partition key ensures write operations are evenly distributed across physical partitions, whereas using `timestamp` would create a hot partition.
High cardinality in partition keys is crucial to avoid hot partitions and throttling in DynamoDB.
3
Configure the capacity scaling mode and read cache.
Select On-Demand capacity mode to dynamically adjust to spiky read/write patterns, and deploy Amazon DynamoDB Accelerator (DAX) to serve reads with sub-millisecond latency.
On-Demand mode prevents over-provisioning or throttling for unpredictable traffic, and DAX provides microsecond latency for cached reads.

Anahtar Kavram

High-Performing Database Solutions
Tahmini Süre:2m 0s
Bu soruyu puanla