Soru

Zorluk: OrtaHigh-Performing Database Solutions

A solutions architect is designing a real-time advertising analytics platform to ingest and store ad impression events. The platform receives millions of write operations per minute. The system must support querying data by `campaign_id` sorted by `timestamp` to display real-time campaign performance. There are fewer than 100100 active campaigns at any given time, but the traffic is distributed unevenly across them, with some popular campaigns receiving the majority of the impressions. Which database design strategy should the solutions architect implement to ensure high write throughput and avoid throttling in Amazon DynamoDB?

  1. A
    Use a partition key of campaign_id and a sort key of timestamp, and deploy an Amazon DynamoDB Accelerator (DAX) cluster to cache write requests.
  2. Create a partition key by appending a random integer suffix to the campaign_id, and use timestamp as the sort key.Cevap
  3. C
    Use campaign_id as the partition key and timestamp as the sort key directly.
  4. D
    Use timestamp as the partition key and campaign_id as the sort key.

Cevap

Create a partition key by appending a random integer suffix to the campaign_id, and use timestamp as the sort key.
The correct option is to append a random integer suffix to the campaign_id. In Amazon DynamoDB, a single partition can support up to 10001000 Write Capacity Units (WCUs). If write traffic is concentrated on a small number of keys, it leads to hot partitions and throttling. Appending a random suffix (write sharding) distributes the writes for a single campaign across multiple partitions, maintaining high write performance.

Adım Adım Çözüm

1
Analyze the access pattern and data distribution requirements.
The application needs high write throughput for millions of events per minute, with fewer than 100100 active campaigns, meaning query traffic is highly concentrated on a small set of campaign IDs.
Identifying the skew in campaign traffic highlights the risk of partition hot-spotting if campaign_id is used as the partition key directly.
2
Evaluate partitioning and sharding strategies to distribute write traffic.
Adding a random integer suffix to the partition key (e.g., campaign_id_1 to campaign_id_N) splits the data for a single campaign across multiple physical partitions.
Distributing the writes across multiple partitions avoids exceeding the throughput limit of a single partition, which is 10001000 Write Capacity Units (WCUs) in DynamoDB.
3
Determine the role of caching in resolving write bottlenecks.
DAX does not solve write bottlenecks because all write operations are write-through to the database.
Caching mechanisms like DAX only optimize read latency and do not reduce the write load on the underlying database.

Anahtar Kavram

Write sharding (using partition key suffixes) to distribute high-throughput write traffic evenly across DynamoDB partitions.
Tahmini Süre:1m 30s
Bu soruyu puanla