Question

Difficulty: MediumCost-Optimized Database Design and Capacity Planning

A logistics company is designing the database architecture for a new package tracking application. The application will receive rapid status updates from delivery drivers' handheld devices. The traffic profile consists of a stable baseline of approximately 200200 writes per second during business hours, but it experiences sudden, unpredictable spikes of up to 5,0005,000 writes per second when major distribution centers scan incoming shipments. The database must store these updates, which consist of simple key-value pairs of tracking ID, timestamp, and location. The company wants to minimize database costs while ensuring that no updates are throttled. Which database design and capacity configuration is the most cost-effective for this workload?

  1. Deploy an Amazon DynamoDB table configured in on-demand capacity mode.Answer
  2. B
    Deploy an Amazon DynamoDB table in provisioned capacity mode with Auto Scaling enabled, setting the minimum write capacity units (WCUs) to 200200 and the maximum to 5,0005,000.
  3. C
    Deploy an Amazon RDS for PostgreSQL Multi-AZ DB instance with two read replicas, and configure the application to route write spikes to the standby replica.
  4. D
    Deploy an Amazon DynamoDB table in provisioned capacity mode, statically provisioning 5,0005,000 write capacity units (WCUs).

Answer

Deploying an Amazon DynamoDB table in on-demand capacity mode is the most cost-effective design.
Deploying an Amazon DynamoDB table in on-demand capacity mode is the most cost-effective choice. The application data consists of simple key-value pairs, which is a perfect match for DynamoDB. Because the write spikes are sudden and unpredictable, on-demand capacity mode scales immediately to accommodate up to 5,0005,000 writes per second without throttling. This prevents the need to pay for statically provisioned peak capacity during baseline periods of 200200 writes per second.

Step-by-Step Solution

1
Analyze the database requirements and data model.
The application requires storing simple key-value pairs (tracking ID, timestamp, location), which aligns with NoSQL databases like Amazon DynamoDB rather than a more expensive relational database like Amazon RDS.
Choosing the correct database engine based on data structure is the first step in cost-optimization.
2
Evaluate the traffic patterns and scaling needs.
The traffic has a baseline of 200200 writes per second but experiences sudden, unpredictable spikes of up to 5,0005,000 writes per second.
Capacity planning requires selecting a scaling mechanism that matches the speed and predictability of workload spikes.
3
Compare DynamoDB capacity modes for cost and throttling prevention.
On-demand capacity mode scales instantly to handle the 5,0005,000 writes per second spike without throttling and charges only for consumed capacity. Provisioned capacity with Auto Scaling is too slow to react to sudden spikes, leading to throttling, while static provisioning of 5,0005,000 WCUs is highly wasteful.
On-demand mode eliminates idle capacity costs while meeting the high availability and zero-throttling requirements.

Key Concept

Selecting the cost-optimal database engine and capacity scaling mode based on workload data structure and predictability.
Rate this question