TalksAWS re:Invent 2025 - Dive deep into Amazon DynamoDB (DAT435)
AWS re:Invent 2025 - Dive deep into Amazon DynamoDB (DAT435)
Dive Deep into Amazon DynamoDB
Overview of DynamoDB
DynamoDB is a document and key-value store that provides predictable low latency at any scale
It is used for foundational services like login, inventory management, and the control plane of most AWS services
DynamoDB aims to provide over 99.999% availability and single-digit millisecond latency, even at massive scale
Scalability and Performance
DynamoDB can handle over 17,000 bathtubs worth of requests per minute (equivalent to 61 seconds to fill an Olympic-sized swimming pool)
Horizontal scaling is achieved through hash-based partitioning, where data is sorted and stored in contiguous partitions
Case Study 1: Unexpected Write Throttling
A customer building a nationwide poll application experienced unexpected write throttling at 800 TPS, despite a simple read-write architecture
The application used randomized IDs to ensure anonymity, but the deterministic hashing algorithm led to uneven distribution of writes across partitions
The solution was to prefix the IDs with a few characters to leverage the "avalanche" property of the hash function and distribute writes evenly
Case Study 2: Counterintuitive Latency Patterns
Another customer had an application with high-traffic batch workloads and low-traffic interactive workloads
Surprisingly, the low-traffic interactive workloads experienced high and variable latency, while the high-traffic batch workloads had low, predictable latency
This was due to the caching behavior of DynamoDB's request routers - the low-traffic workloads were not benefiting from the caches, while the high-traffic workloads were
The solution was to route the low-traffic workloads to a smaller number of hosts to ensure they could leverage the caches
Key Takeaways
Understanding the inner workings of the database is crucial for building effective applications
DynamoDB's hash-based partitioning and caching mechanisms can lead to unexpected performance characteristics if not properly accounted for
Customers should carefully consider their workload patterns and leverage DynamoDB's features to optimize for performance and cost
Detailed monitoring and simulation can help identify and resolve performance issues in complex, real-world applications
Technical Details
DynamoDB uses a deterministic hash function with "avalanche" properties to distribute data across partitions
Caching is extensively used in the request routing and authentication/authorization layers to handle massive scale
Customers can leverage prefixing or routing strategies to work around potential performance issues related to hash-based partitioning and caching
Business Impact
The ability to handle massive scale and provide predictable low latency makes DynamoDB a critical component for mission-critical, high-availability applications
The case studies demonstrate how DynamoDB's underlying architecture can impact real-world applications, and how customers can work around these challenges
Understanding these performance characteristics is essential for building robust, scalable applications on top of DynamoDB
These cookies are used to collect information about how you interact with this website and allow us to remember you. We use this information to improve and customize your browsing experience, as well as for analytics.
If you decline, your information won’t be tracked when you visit this website. A single cookie will be used in your browser to remember your preference.