# AWS DynamoDB

> Amazon DynamoDB is a fully managed, serverless NoSQL key-value and document database with single-digit millisecond latency at any scale.

- Source: https://www.itwonderlab.com/aws-dynamodb/
- Published: 2026-10-05
- Updated: 2026-10-05
- Author: Javier Ruiz Jiménez (https://www.javierruizjimenez.com/)
- Site: IT Wonder Lab (https://www.itwonderlab.com/)

---

**Amazon DynamoDB** is a fully managed NoSQL database for applications that need consistent, single-digit millisecond performance at any scale. There are no servers, patches or clusters to manage, and data is automatically replicated across three Availability Zones of a Region.

### Key concepts

- **Table**, **item** (a row) and **attributes**. Items in the same table can have different attributes.
- **Primary key**: a *partition key*, or a partition key plus a *sort key*. The partition key decides where the item is stored, so a good key spreads the load evenly.
- **Secondary indexes**: *global* (GSI) and *local* (LSI) indexes to query by other attributes.
- **Capacity modes**: *on-demand* (pay per request, no planning) or *provisioned* with Auto Scaling (read and write capacity units).
- **Consistency**: eventually consistent reads by default, strongly consistent reads optionally, and ACID **transactions**.
- **Global tables** replicate a table across Regions with multi-active writes.
- **Streams** deliver the item changes to [Lambda](https://www.itwonderlab.com/aws-lambda/) or other consumers; **TTL** deletes expired items automatically; **point-in-time recovery** and on-demand backups protect the data; **DAX** is an in-memory cache.
- Data is encrypted at rest with [KMS](https://www.itwonderlab.com/aws-kms/).
- Access is through the API (not SQL connections), controlled with [IAM](https://www.itwonderlab.com/aws-iam/).

### Pricing

On-demand: per read and write request. Provisioned: per capacity unit per hour. Plus storage and optional features such as global tables, backups and streams. See the [DynamoDB pricing](https://aws.amazon.com/dynamodb/pricing/).

### With Terraform

The resource is `aws_dynamodb_table` (also `aws_dynamodb_table_item` and `aws_appautoscaling_target` for scaling). DynamoDB was also the traditional way to **lock the Terraform state** stored in S3, with a table whose key is `LockID`.

See tutorials:

-   [AWS with Terraform Tutorial: Terraform Backends (19)](https://www.itwonderlab.com/aws-terraform-tutorial-terraform-backends/)

See also: [AWS RDS](https://www.itwonderlab.com/aws-rds/) and [AWS Aurora](https://www.itwonderlab.com/aws-aurora/) for relational databases, [AWS ElastiCache](https://www.itwonderlab.com/aws-elasticache/).
