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.
Table of Contents
- Key Facts
- Updates & Feature Releases
- When To Use
- When Not To Use
- Available Regions
- Use Cases
- Frequently Asked Questions
|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)|
DynamoDB Updates & Feature Releases [2012 - Today]
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.
Frequently Asked Questions
What is DynamoDB used for?
DynamoDB has a variety of use cases ranging from simple key-value stores through traditional relational databases and even time series.
Is DynamoDB fast?
It depends. DynamoDB might seem slower than some in-memory stores like Redis but DynamoDB is persistent and has different use cases. It’s "the webscale" where DynamoDB outperforms all traditional relational databases. It has very predictable performance, no matter the size of your dataset, whether it’s only 1GB or 100TB, the speed of reads and writes remains the same, actually, it gets even better with scale. DynamoDB proved to be capable of serving over 45 million requests per second during Prime Day.
Does DynamoDB Support SQL?
Out of the box, no. Fortunately, there are few options to query DynamoDB with SQL: - Use Athena Federated Queries - Use DQL or some other Open Source solutions - Soon it will be possible with Dynobase
Is Redis faster than DynamoDB?
It’s comparing apples to oranges. While Redis is in-memory data store, perfect for caches or sessions store, DynamoDB is persistent NoSQL database. While Redis is superfast for small datasets, it gets pricier and pricier.
Is DynamoDB serverless?
Yes, DynamoDB is “serverless” in a sense that you don’t have to manage it or patch and care about underlying servers or software that it runs on. It’s fully administered by AWS and all you need to do is just use it.
Is DynamoDB highly available?
Yes, it’s highly available, scalable, and distributed data store.
Is DynamoDB columnar database?
No. If you’re looking for a columnar database, consider using Redshift.
When to use DynamoDB vs S3?
While S3 is object storage, DynamoDB is NoSQL database. S3 is more suitable for storing large files durably while DynamoDB is rather Key-Value store optimized for huge amount of data and concurrent operations.
Does DynamoDB support atomic updates?
Yes, DynamoDB like many other databases support transactions. With TransactGetItems and TransactWriteItems you can read/write up to 25 items per transaction.
Is DynamoDB eventually consistent?
There are two modes that user can use when working with DynamoDB: - Strong Consistency (Read-after-Write) - Eventual Consistency
Is DynamoDB a memory store?
While DynamoDB is not in-memory store, DynamoDB Accelerator (DAX) is an in-memory cache supplementing DynamoDB tables that delivers fast read performance for your tables at scale by enabling you to use a fully managed in-memory cache.
How to Add a Column in DynamoDB?
DynamoDB doesn't have a concept of columns. Each item consists of a Key and the attributes. Because it's a NoSQL database and doesn't have a strict schema, each item can have a different set of attributes, you can write whatever you like in each operation.
© 2020 Dynobase