Skip to content
Back to Cloud Services

AWS DynamoDB NoSQL Database

Single-digit ms latency key-value/Document DB at any scale, with on-demand pricing and global tables.

AWSAdvanced

Why

DynamoDB delivers <10ms at any scale — 10M+ RPS — with zero capacity planning (on-demand). Global Tables replicate across regions.

Free tier: 25GB + 200M reads/mo. No connection pooling needed.

When

Use for session stores, shopping carts, user profiles, and high-throughput key lookups. Avoid for relational queries/joins (use RDS) or ad-hoc analytics (use Athena).

How

1. Create table — aws dynamodb create-table with PartitionKey (+ SortKey) 2. Capacity — on-demand (pay per request) or provisioned (RCU/WCU) 3. Query — Query by partition key, SortKey conditions; Scan for full (expensive) 4. Indexes — GSI for alternate access patterns, LSI for same partition 5. Single-table design — store related items together, design access patterns first 6. Global Tables — multi-region active-active, <1s replication 7. Streams — capture changes, trigger Lambda (replicate, aggregate) 8. DAX — in-memory cache, microsecond reads, 5x cost of DynamoDB

Example

# Create table with on-demand billing aws dynamodb create-table \ --table-name users \ --attribute-definitions AttributeName=pk,AttributeType=S AttributeName=sk,AttributeType=S \ --key-schema AttributeName=pk,KeyType=HASH AttributeName=sk,KeyType=RANGE \ --billing-mode PAY_PER_REQUEST // Query with Node SDK import { DynamoDBDocumentClient, QueryCommand } from "@aws-sdk/lib-dynamodb"; const result = await docClient.send(new QueryCommand({ TableName: "users", KeyConditionExpression: "pk = :pk AND begins_with(sk, :sk)", ExpressionAttributeValues: { ":pk": "USER#123", ":sk": "ORDER#" }, })); // Single-table: USER#123 | PROFILE#, USER#123 | ORDER#456 // One query fetches user + all orders by partition key

Common Problems

  • ⚠Hot partition key — one popular key throttles, design to distribute traffic evenly
  • ⚠Scan is expensive — reads entire table, use Query with GSI instead
  • ⚠1MB item limit — large documents must be split or stored in S3 with pointer

Best Practices

  • ✓Single-table design — one table, many access patterns, reduces cost and complexity
  • ✓Use on-demand for unknown traffic — provisioned only for steady, predictable load
  • ✓Design GSIs for read patterns — each GSI = one query pattern, plan before building

FAQ

What is AWS DynamoDB NoSQL Database and what problem does it solve?

Single-digit ms latency key-value/Document DB at any scale, with on-demand pricing and global tables. It lets developers deploy, store, and scale without self-managing infrastructure — a core reference for cloud service selection.

How do I get started with AWS DynamoDB NoSQL Database in 5 minutes?

Two steps to run it: (1) Create table — aws dynamodb create-table with PartitionKey (+ SortKey); (2) Capacity — on-demand (pay per request) or provisioned (RCU/WCU). Validate on the free tier first, then wire into production.

What is the #1 pitfall with AWS DynamoDB NoSQL Database?

The most frequent issue is: Hot partition key — one popular key throttles, design to distribute traffic evenly. Run a pre-launch checklist item by item, and add policy/config scanning in CI.

What are the best practices for AWS DynamoDB NoSQL Database?

Best practices for AWS DynamoDB NoSQL Database include: Single-table design — one table, many access patterns, reduces cost and complexity; Use on-demand for unknown traffic — provisioned only for steady, predictable load; Design GSIs for read patterns — each GSI = one query pattern, plan before building. The first one — "Single-table design — one table, many access patterns, reduces cost and complexity" — should be a team default baked into your IaC templates.

How do I control cost and avoid bill surprises with AWS DynamoDB NoSQL Database?

Three ways to prevent overspend: (1) tag every resource with env/team and enable billing alarms; (2) set budget thresholds to trigger Slack/email alerts; (3) review idle resources in Cost Explorer regularly and clean them up. Most AWS DynamoDB NoSQL Database options offer a free tier — validate within free quota before scaling.