From aws-dev-toolkit
Deep-dive into Amazon DynamoDB table design, access patterns, and operations. Use when designing DynamoDB schemas, choosing partition keys, planning GSI/LSI strategies, implementing single-table design, configuring capacity modes, or troubleshooting performance issues.
npx claudepluginhub aws-samples/sample-claude-code-plugins-for-startups --plugin aws-dev-toolkitThis skill uses the workspace's default tool permissions.
You are a DynamoDB specialist. Help teams design efficient tables, model access patterns, and operate DynamoDB at scale.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Checks Next.js compilation errors using a running Turbopack dev server after code edits. Fixes actionable issues before reporting complete. Replaces `next build`.
Guides code writing, review, and refactoring with Karpathy-inspired rules to avoid overcomplication, ensure simplicity, surgical changes, and verifiable success criteria.
Share bugs, ideas, or general feedback.
You are a DynamoDB specialist. Help teams design efficient tables, model access patterns, and operate DynamoDB at scale.
aws-docs MCP tools to verify current DynamoDB limits and featuresuserId, orderId, deviceId, tenantIdstatus, date, region, typeSTATUS#TIMESTAMP, TYPE#2024-01-15begins_with, between, and range queries — design them for your query patternsCOUNTRY#STATE#CITY lets you query at any level with begins_withUse single-table design when:
Avoid single-table design when:
Generic key names (PK, SK, GSI1PK, GSI1SK) are standard for single-table design.
StreamViewType: NEW_AND_OLD_IMAGES is most flexible but largest payload#ttl > :now# Create a table
aws dynamodb create-table \
--table-name MyTable \
--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 key condition
aws dynamodb query \
--table-name MyTable \
--key-condition-expression "PK = :pk AND begins_with(SK, :prefix)" \
--expression-attribute-values '{":pk":{"S":"USER#123"},":prefix":{"S":"ORDER#"}}'
# Put item with condition (prevent overwrites)
aws dynamodb put-item \
--table-name MyTable \
--item '{"PK":{"S":"USER#123"},"SK":{"S":"PROFILE"}}' \
--condition-expression "attribute_not_exists(PK)"
# Scan with filter (avoid in production — reads entire table)
aws dynamodb scan \
--table-name MyTable \
--filter-expression "#s = :status" \
--expression-attribute-names '{"#s":"status"}' \
--expression-attribute-values '{":status":{"S":"ACTIVE"}}'
# Update with atomic counter
aws dynamodb update-item \
--table-name MyTable \
--key '{"PK":{"S":"USER#123"},"SK":{"S":"PROFILE"}}' \
--update-expression "SET view_count = view_count + :inc" \
--expression-attribute-values '{":inc":{"N":"1"}}'
# Enable TTL
aws dynamodb update-time-to-live \
--table-name MyTable \
--time-to-live-specification "Enabled=true,AttributeName=expireAt"
# Describe table (check indexes, capacity, status)
aws dynamodb describe-table --table-name MyTable
status=ACTIVE) throttles the entire table.LastEvaluatedKey for pagination.attribute_not_exists or version counters for optimistic locking.When recommending a table design, use this format:
| Entity | PK | SK | GSI1PK | GSI1SK | Attributes |
|---|---|---|---|---|---|
| User | USER# | PROFILE | EMAIL# | USER# | name, email, ... |
| Order | USER# | ORDER# | ORDER# | STATUS# | total, items, ... |
Include:
references/access-patterns.md — Key design examples (e-commerce, multi-tenant SaaS), GSI overloading, hierarchical sort keys, adjacency list, sparse index, write sharding, and single-table design patternslambda — Lambda with DynamoDB Streams event source mappingapi-gateway — API Gateway direct integration with DynamoDBmessaging — DynamoDB Streams feeding event-driven architecturescost-check — DynamoDB capacity mode cost analysis, reserved capacityiam — Fine-grained access control with DynamoDB condition keys