What Is DynamoDB? Ultimate Introduction for Beginners
Written by Rafal Wilinski
Published on 2022-04-11
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, Multi-region 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
|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)|
Anatomy of DynamoDB
Data in DynamoDB is arranged into "Tables". Each Table consists of "Items". Each "Item" consists of "Attributes".
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. Moreover, the costs of DynamoDB are very predictable.
DynamoDB can be used for almost anything, including:
- Simple key-value store like metadata store
- Relational data store (Using Adjacency List Pattern \ Single Table Design)
- Geographical data, using Geohashing
- Timeseries, using multiple tables per period
- Caching (even more efficient with DAX)
- Event-driven transaction processing (thanks to DynamoDB Streams)
- Session store/history with TTL (time-to-live)
- Shopping carts using Transactions
- Workflow engines
- Relationship graph data stores (Using Adjacency List Pattern)
Moreover, when choosing the database for your next project, you should award a few extra points to DynamoDB if:
- You want to go Serverless. DynamoDB integrates with AWS Lambda and other AWS Serverless offerings really well
- You are going to deal with massive traffic with erratic spikes
- You want to be asynchronous and event-driven
- You want to minimize your costs and scale them ideally with your application usage
Read more about Common DynamoDB Misconceptions here.
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 capabitilies.~ With PartiQL, this is now possible!
- If you need to run ad-hoc queries on whole dataset, you might consider replicating DynamoDB data to Redshift or other relational database
© 2022 Dynobase