DynamoDB
Amazon DynamoDB
- Pronunciation
- dy-NAM-oh dee-BEE
In short
Amazon DynamoDB is a fully managed NoSQL database on AWS that stores items by key, scales automatically and answers lookups in single-digit milliseconds.
What is DynamoDB?
AWS launched DynamoDB in 2012, building on ideas from Amazon's earlier internal Dynamo system. There are no servers to run: you create a table, choose how to pay for capacity, either on demand per request or provisioned in advance, and AWS handles storage, replication across availability zones, backups and scaling.
Every item is found by its primary key. A simple key is a partition key alone, such as userId; a composite key adds a sort key, such as orderDate, so one partition can hold many related items in order. DynamoDB spreads partitions across many machines by hashing the partition key, which is what lets it grow to huge sizes while keeping lookups fast.
Queries work best along the keys: get one item, or read a range of items in one partition. Global and local secondary indexes add other access patterns, DynamoDB Streams emits a change feed for triggers and pipelines, and global tables replicate data across regions. Transactions are supported across multiple items.
A common misconception is that DynamoDB can be designed like a relational database. It has no joins and ad hoc queries are expensive, so you design tables around the queries you know you'll need, often storing several entity types in one table. Choosing a partition key with many distinct values also matters, because a hot key that receives most of the traffic can be throttled.
Key takeaways
- DynamoDB is a fully managed key-value and document database on AWS.
- Items are found by a partition key, optionally with a sort key.
- It scales horizontally by spreading partitions across many machines.
- Secondary indexes, streams, global tables and transactions are built in.
- Tables are designed around access patterns; there are no joins.
Example
import { DynamoDBClient } from "@aws-sdk/client-dynamodb";
import { DynamoDBDocumentClient, PutCommand, QueryCommand } from "@aws-sdk/lib-dynamodb";
const db = DynamoDBDocumentClient.from(new DynamoDBClient({ region: "eu-central-1" }));
// Partition key: userId, sort key: orderDate
await db.send(new PutCommand({
TableName: "Orders",
Item: { userId: "u42", orderDate: "2026-10-03", total: 49 },
}));
// All of one user's orders since October, in date order
const { Items } = await db.send(new QueryCommand({
TableName: "Orders",
KeyConditionExpression: "userId = :u AND orderDate >= :d",
ExpressionAttributeValues: { ":u": "u42", ":d": "2026-10-01" },
}));Readers ask
Is DynamoDB SQL or NoSQL?
NoSQL. It is a key-value and document store. AWS offers a SQL-compatible query language called PartiQL for it, but the data model and performance still follow keys, not relational tables.
What is the difference between DynamoDB and MongoDB?
Both store documents. MongoDB has richer ad hoc queries and aggregations and can run anywhere. DynamoDB is AWS-only and fully serverless, with predictable performance as long as queries follow the keys and indexes you designed.
What is single-table design?
A DynamoDB pattern where several related entity types, such as customers and their orders, share one table and are told apart by their keys, so related data can be read in a single query.
See also
- NoSQLDatabases, p. 29NoSQL is a family of databases that store data in models other than relational tables, such as documents, key-value pairs, wide columns, or graphs.
- Key-Value StoreDatabases, p. 25A key-value store is a NoSQL database that saves each piece of data under a unique key, so an application can read or write it by that key very quickly.
- AWSDevOps & Cloud, p. 3AWS (Amazon Web Services) is Amazon's cloud platform: more than 200 pay-as-you-go services for servers, storage, databases and much more.
- ShardingDatabases, p. 39Sharding is a way of scaling a database by splitting its data across several servers, called shards, so each one stores and handles only part of the total.
- Document DatabaseDatabases, p. 15A document database is a NoSQL database that stores each record as a self-contained document, usually JSON-like, whose fields can differ from record to record.
- ServerlessDevOps & Cloud, p. 47Serverless is a cloud model in which the provider runs your code on demand, manages all the servers, scales automatically, and bills only for actual use.
Spotted a mistake or something missing on this page?Suggest an edit