What is DynamoDB?
DynamoDB is a fast NoSQL Database developed and fully managed by Amazon Web Services (AWS). It's often referred to as a key-value store, but DynamoDB offers much more than that, including Streams, Global and Local Secondary Indexes, Multiregion, and Multimaster replication with enterprise-grade security and in-memory caching for big scale.
Unlike traditional RDBMS databases, you don't have to provision a "database" or underlying machines. All you need to do is create a table and start writing and reading data from it. It's web-scale and production-ready right from the start.
DynamoDB is a perfect choice for Serverless applications because it follows the pay-what-you-use model and integrates perfectly with AWS Lambda and other services from AWS.
|Model||Key-value Store, Document|
|Initial Release Date||January 18, 2012|
|Cloud-based||Yes, fully managed, no servers to provision or manage|
|Runnable locally||No (technically yes, but only for test and dev purposes)|
|SQL Support||Generally no, possible via AWS Athena|
|API||Yes, RESTful HTTP API|
|Transactions support||Yes, ACID|
|Backups||Yes, including point-in-time without downtime|
|Monitoring||Yes, with CloudWatch|
|Capacity modes||Provisioned (with optional scaling), On-Demand|
|Encryption||Yes, using KMS customer or AWS managed|
|Scalability||Yes, up to 10 trillion requests per day and 20M requests per second|
|Caching||Yes, possible using DynamoDB Accelerator (DAX)|
When to use DynamoDB
DynamoDB is a perfect choice for all sizes of applications, especially if your application needs predictable read and write performance. DynamoDB thanks to automatic scaling is able to survive the biggest traffic spikes.
DynamoDB can be used for almost anything, including:
- Simple key-value store
- Relational data store (Using Adjacency List Pattern)
- Geographical data using Geohashing
- Event-driven transaction processing
- Game stats and session history
- Shopping carts
- Workflow engines
- User content metadata stores
- Relatiionship graph data stores
When not to use DynamoDB
Even though DynamoDB can be used for almost anything you can imagine, there are some cases when you shouldn't use it.
- If your software is running outside of AWS Cloud, like inside other cloud or on-premise, you might consider storing your data closer to your application in order to minimize latency between database and service.
- If you need to use SQL.
DynamoDB supports two scaling modes:
- Provisioned with Autoscaling - DynamoDB adjusts the amount for "Write Capacity Units" (WCU) and "Read Capacity Units" (RCU)
- On-Demand Mode - requires from you no capacity planning at all, billed on per-request basis
DynamoDB is available in the following 19 regions:
- US East (Ohio) us-east-2
- US East (N. Virginia) us-east-1
- US West (N. California) us-west-1
- US West (Oregon) us-west-2
- Asia Pacific (Hong Kong) ap-east-1
- Asia Pacific (Mumbai) ap-south-1
- Asia Pacific (Osaka-Local) ap-northeast-3
- Asia Pacific (Seoul) ap-northeast-2
- Asia Pacific (Singapore) ap-southeast-1
- Asia Pacific (Sydney) ap-southeast-2
- Asia Pacific (Tokyo) ap-northeast-1
- Canada (Central) ca-central-1
- Europe (Frankfurt) eu-central-1
- Europe (Ireland) eu-west-1
- Europe (London) eu-west-2
- Europe (Paris) eu-west-3
- Europe (Stockholm) eu-north-1
- Middle East (Bahrain) me-south-1
- South America (São Paulo) sa-east-1
Anatomy of DynamoDB
Data in DynamoDB is arranged into "Tables". Each Table consists of "Items". Each "Item" consists of "Attributes".
Notable use cases
- DynamoDB is used by Amazon.com and by fulfilment centres. During the Prime Day, there were made 7.11 trillion calls to the DynamoDB API, peaking at 45.4 million requests per second.
- DynamoDB is used by Lyft for tracking all rides.
- Netflix uses DynamoDB to run A/B tests.
- Snapchat uses DynamoDB for Stories.
© 2020 Dynobase