Soru

Zorluk: ZorHigh-Performing Database Solutions

A logistics enterprise is designing a real-time fleet tracking system that must ingest and process location updates from over 5000050{}000 active delivery vehicles. The system expects a write workload of up to 2000020{}000 writes per second. Customer dashboards require real-time tracking updates with read latency under 10 ms10\text{ ms}. The database must scale automatically to handle peak traffic during holiday seasons without performance degradation or partition bottlenecks. Which database architecture provides the highest performance and scalability for this application?

  1. A
    Amazon Aurora PostgreSQL with a single primary instance and a Read Replica in a separate Availability Zone, designating the Read Replica as the primary disaster recovery target via manual failover.
  2. B
    Amazon DynamoDB with `delivery_date` (formatted as `YYYY-MM-DD`) as the partition key and `delivery_id` as the sort key, utilizing DynamoDB Accelerator (DAX) to optimize write throughput.
  3. Amazon DynamoDB with `delivery_id` as the partition key and `status_timestamp` as the sort key, utilizing DynamoDB Auto Scaling to manage capacity.Cevap
  4. D
    Amazon RDS for PostgreSQL in a Multi-AZ deployment, using Read Replicas as the direct, automatic failover targets to handle both write and read traffic during peak periods.

Cevap

Use Amazon DynamoDB with `delivery_id` as the partition key and `status_timestamp` as the sort key, utilizing DynamoDB Auto Scaling to manage capacity.
The correct design uses Amazon DynamoDB with a high-cardinality partition key (`delivery_id`) and a sort key (`status_timestamp`). This distributes writes evenly across multiple physical partitions, preventing write throughput bottlenecks. DynamoDB Auto Scaling dynamically adjusts provisioned throughput based on traffic, satisfying both high-throughput write and low-latency read requirements.

Adım Adım Çözüm

1
Analyze the workload requirements for read/write scaling.
The workload requires scaling to 2000020{}000 writes per second with sub-10 ms10\text{ ms} read latency, which exceeds typical single-instance relational database limits and points to a NoSQL database.
Amazon DynamoDB handles horizontal scaling and low-latency reads/writes natively.
2
Design the partition key to avoid hot partition bottlenecks.
Select a high-cardinality attribute like `delivery_id` as the partition key to distribute write operations evenly across DynamoDB partitions.
Low-cardinality keys like date strings concentrate writes on a single partition, leading to throttling.
3
Select the appropriate scaling mechanism for seasonal traffic.
Enable DynamoDB Auto Scaling (or On-Demand mode) to adjust capacity dynamically to workload demand.
Auto Scaling prevents throttling during traffic spikes and optimizes cost during low-use periods.

Anahtar Kavram

Amazon DynamoDB partition key design and scaling for high-throughput write workloads.
Tahmini Süre:2m 0s
Bu soruyu puanla