Patterns and best practices for Amazon DynamoDB data modeling and access patterns. Use when the user asks about DynamoDB table design, single-table design, GSIs, multi-attribute composite keys, one-to-many relationships, cost optimization, or Terraform DynamoDB resources. Triggers on: DynamoDB, single-table design, GSI, partition key, sort key, access patterns, filter expressions, TTL, vertical sharding, composite keys, multi-attribute keys.
90
90%
Does it follow best practices?
Impact
86%
1.30xAverage score across 3 eval scenarios
Passed
No findings from the security scan
Multi-attribute composite GSI with DynamoDB Streams in Terraform
No synthetic concatenated keys
0%
100%
Multi-attribute GSI definition
0%
100%
Provider version constraint
0%
100%
All PK attributes in queries
90%
100%
SK left-to-right order, no gaps
100%
100%
Inequality only on final SK attribute
100%
100%
ExpressionAttributeNames for reserved words
70%
100%
KEYS_ONLY or INCLUDE projection
0%
0%
Stream enabled with NEW_AND_OLD_IMAGES
100%
100%
DynamoDB issue tracker — sort key design and atomic reference counts
Access patterns first
75%
100%
Status in sort key
50%
0%
No status FilterExpression
100%
100%
Zero-padded issue numbers
100%
100%
# prefix or numeric-difference trick
41%
50%
Single query for project + recent issues
100%
100%
TransactWriteItems for issue creation
100%
100%
attribute_not_exists idempotency
100%
100%
No count-at-read-time
100%
100%
Session & notification DynamoDB layer — TTL guards, sparse GSI, vertical sharding
TTL as epoch integer
75%
100%
ExpiresAt as ISO string
0%
0%
TTL guard on session reads
100%
83%
Sparse GSI attributes on notification create
100%
100%
Mark-as-read removes GSI attributes
66%
100%
Unread query targets sparse GSI
100%
100%
No status FilterExpression for unread
100%
100%
Vertical sharding — two items per session
0%
100%
Vertical sharding — same partition key
0%
100%
Notifications as separate items
100%
100%
Schema design rationale
100%
100%
2b66211
Table of Contents
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.