Architecture note2 lab guides2 lab guides
DynamoDB · NoSQL Key-Value Store
Partition key design, hot keys, and capacity modes that quietly cost you money.
Outcome
- Explain the difference between
dynamodb:GetItemanddynamodb:Queryand why having one doesn't imply the other - List the access patterns for a service before designing any table
- Map each access pattern to a base table key or GSI
- Explain why IAM policy typos in resource ARNs are undetectable at creation time
- Explain the difference between
- Explain partition key, sort key, and how DynamoDB co-locates items by PK
- Create a table with GSIs in one CLI call
- Use
PutItem,GetItem,UpdateItem,DeleteItemcorrectly - Use expression attribute names to alias reserved words
- Explain why
PutItemis a full overwrite and when to useUpdateIteminstead - Explain the cost difference between Query and Scan with
--return-consumed-capacity
- Explain why single-table design exists and what problem it solves
- Model multiple entity types using generic PK/SK patterns
- Use
begins_with(SK, prefix)to filter entity types within a partition - Explain why
#separators prevent SK prefix collisions - Explain the difference between
FilterExpressionandKeyConditionExpression
- Explain when to use a GSI vs an LSI
- Query a GSI with
--index-nameand a date range SK condition - Add a GSI to an existing table and wait for backfill
- Explain GSI eventual consistency and why you can't read from a GSI immediately after writing
- Explain the hot partition problem on low-cardinality GSI PKs
- Enable TTL and explain why the attribute must be a Number type
- Enable Streams with
NEW_AND_OLD_IMAGESand connect a Lambda consumer - Distinguish TTL deletes from application deletes in stream records
- Explain at-least-once delivery and why stream consumers must be idempotent
- Explain what happens when a Lambda stream consumer fails repeatedly
- Use
attribute_not_exists(PK)for idempotent creates - Implement optimistic locking with a version attribute
- Use
TransactWriteItemsfor atomic multi-item writes - Explain why transactions cost 2× WCU and when not to use them
- Explain what
ConditionalCheckFailedExceptionmeans and how to handle it with retry logic - Calculate RCU cost for a strongly consistent vs eventually consistent read
- Use