Amazon DynamoDB is a fully managed, highly available, scalable, NoSQL database with support for both key-value and documents schemas. DynamoDB tables scale in both storage and throughput capacity dimensions - storage capacity is scaled automatically, throughput capacity manually or automatically.
(A hi-res, PDF version of this diagram is located here)
Items in a DynamoDB table are stored on physical disk partitions. Each partition has a maximum storage capacity of 10 GB, and throughput capacity of 1000 Write Capcity Units (WCU) or 3000 Read Capacity Units (RCU) (or some combination thereof). When a partition fills to capcity DynamoDB automatically splits the partition into 2 and moves half the data to one and half to the other. The throughput capcity of each of the new (now half full) partitions is half that of the original partition.
Provisioned throughput capacity may be scaled manually or automatically via auto-scaling. If throughput is not scaled, reads and/or writes may be throttled.
Adaptive capacity is now available to combat throughput dilution as a result of partition splits. Adaptive capacity allows one partition to “borrow” throughput capacity from other partitions in the table, up to the provisioned throughput capacity for the table.
Throughput diluation can occur when partitions are split to accomodate increased storage requirements. Data from the source partition is equally divided between the new partitions, as is provisioned throughput. If the parent partition had 1K RCU, each child will get 500 RCU.
If table storage continues to grow and partitions continue splitting, each partition receives a smaller and smaller allocation of the overall provisioned throughput – throughput dilation.
Throughput dilution could previously result in a partition being throttled for exceding it’s allocation of provisioned throughput, even through it wasn’t really that “hot”. Adaptive capacity solves this problem. Cold partitions can now “share” their capacity with hot partitions.
DynamoDB partitions are not removed or consolidated when the storage capacity of the table is reduced, either through normal table activity or use of TTLs. The number of table partitions only ever grows over time.
For additional info on adaptive capacity, see the AWS re:Invent session below:
You shouldn’t write applications that depend on adaptive capacity, as described here.
DynamoDB tables are replicated and stored in 3 seperate facilities within a Region. Data is synchronously copied between replicas to ensure read after write consistency. Note that a ‘facility’ doesn’t mean ‘availability zone’, multiple facilities may be in a single AZ.
Tables may be replicated cross-region using DynamoDB streams. This asynchronous process enables use cases including data migration and DR.
Global tables provide master-master functionality with the ability to both read and write to DynamoDB tables from multiple regions. Strongly consistent reads are supported within region, cross-region reads are eventually consistent.
DynamoDB tables are located in AWS, but not inside a VPC. Connecting to DynamoDB from within a VPC is best accomplished using a DynamoDB endpoint. A DynamoDB endpoint allows communication to occur using private IP addressing and to remain within the AWS network. Alternatively, access to DynamoDB may be accomplished through an Internet Gateway or Virtual Private Gateway.
DynamoDB tables may be encrypted at rest using Amazon’s Key Management Services. Encryption at rest may only be enabled at table creation.
DynamoDB on-demand backups of encrypted tables are stored in S3 (only accessible via DynamoDB, not S3) and encrypted via S3 Server-Side-Encryption.
Amazon DynamoDB pricing is composed primarily of storage and throughput costs. Storage costs are based on GBs per month stored, throughput on provisioned read and write capacity. Backup storage is priced in GB/Mo. Restores are prices in GBs restored.
See the DynamoDB product page for additional information.
- Feb 8, 2018: Amazon DynamoDB Now Supports Server-Side Encryption at Rest
- Jan 26, 2018: AWS Serverless Application Model is Now Available in AWS GovCloud (US) and AWS China (Beijing) Region
- Jan 23, 2018: View and monitor your amortized reservation costs using AWS Cost Explorer, AWS Cost & Usage Reports, and AWS Budgets
- Dec 21, 2017: Amazon Kinesis Data Analytics can now Output Real-Time SQL Results to AWS Lambda
- Nov 29, 2017: AWS Launches Amazon DynamoDB Backup and Restore
- Nov 29, 2017: AWS Launches Amazon DynamoDB Global Tables
- Dec 30, 2013: Amazon DynamoDB Console now available in AWS GovCloud (US)