DynamoDB Workload Management

How DynamoDB Handles Heavy Workload

Question

KindleYou is a location-based social search mobile app that allows users to like or dislike other users, and allows users to chat if both parties liked each other in the app.

It has more than 1 billion customers across the world. They use DynamoDB to support the mobile application and S3 to host the images and other documents shared between users. DynamoDB has a table with 60 partitions and is being heavily accessed by users.

The queries run by users do not fully use the per-partition's throughput.

In less than 3 minutes, a heavy load of queries flow in and this happens occasionally.

Sometimes there are many background tasks that are running in background.

How does DynamoDB handle the workload?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Answer: A.

Option A is correct - DynamoDB provides some flexibility in your per-partition throughput provisioning by providing burst capacity.

DynamoDB reserves a portion of that unused capacity for later bursts of throughput to handle usage spikes.

https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/bp-partition-key-design.html#bp-partition-key-partitions-adaptive

Option B is incorrect -Adaptive Capacity enables your application to continue reading and writing to hot partitions without being throttled, provided that traffic does not exceed your table's total provisioned capacity or the partition maximum capacity.

https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/bp-partition-key-design.html#bp-partition-key-partitions-adaptive

DynamoDB is a highly available, fully managed NoSQL database service provided by Amazon Web Services (AWS) that can handle massive amounts of data and millions of requests per second. It is designed to provide fast and predictable performance for workloads of any scale. KindleYou is a social search mobile app that is heavily accessed by users and uses DynamoDB to support its operations.

The DynamoDB table used by KindleYou has 60 partitions and is being heavily accessed by users. However, the queries run by users do not fully use the per-partition's throughput, and occasionally, a heavy load of queries flows in within three minutes. Additionally, there are background tasks running in the background.

To handle the workload, DynamoDB uses Burst Capacity effectively. Burst Capacity is a feature of DynamoDB that allows a table or partition to temporarily burst beyond its provisioned capacity to handle spikes in traffic. It is available for all read and write operations, and it is based on a credit system that accumulates over time. When the credit balance is exhausted, the table or partition returns to its provisioned capacity. Burst Capacity helps DynamoDB maintain predictable performance even during sudden traffic spikes.

DynamoDB also uses Adaptive Capacity to automatically adjust the amount of provisioned capacity allocated to a table or partition based on its usage patterns. Adaptive Capacity can increase or decrease capacity without requiring any manual intervention, allowing DynamoDB to handle sudden changes in traffic or workload. It is useful for workloads that are unpredictable or have varying levels of demand.

Designing Partition Keys to distribute workload evenly is also an effective way to handle the workload in DynamoDB. By using an optimal partition key, the workload can be evenly distributed across multiple partitions, allowing DynamoDB to achieve maximum performance and throughput.

Using Write Sharding to Distribute Workloads Evenly is another technique that can be used to distribute the workload across multiple partitions. Write sharding is a method of dividing the workload into smaller pieces and distributing it across multiple partitions. Each partition is responsible for a specific subset of the data, reducing the likelihood of contention and improving performance.

In summary, DynamoDB handles the workload of KindleYou by using Burst Capacity effectively, using Adaptive Capacity to automatically adjust provisioned capacity, designing partition keys to distribute the workload evenly, and using Write Sharding to distribute workloads evenly.