D1: DynamoDB Keys, Consistency & Operations
AWS Associate AWS Certified Developer – Associate exam practice questions · 14 flashcards
Question
Partition key vs composite key?
1 / 14
Tip: Space flips the card, ← / → navigate.
Show all 14 DynamoDB Keys, Consistency & Operations practice questions and answers
- Partition key vs composite key?Simple primary key: partition key only. Composite: partition key + sort key.
- Why high-cardinality partition keys?Distribute traffic evenly across partitions, avoiding hot keys.
- Strongly consistent read?Returns most recent data; ConsistentRead=true; 1 RCU per 4 KB; not on GSIs.
- Eventually consistent read?May return stale data briefly; half the RCU cost.
- Query vs Scan?Query finds items by key efficiently; Scan reads all items — slow and costly.
- GSI?Global secondary index: alternate partition/sort keys, own capacity, eventually consistent, add anytime.
- LSI?Local secondary index: same partition key, different sort key, created at table creation, strong consistency allowed.
- Projected attributes?Attributes copied into an index (KEYS_ONLY, INCLUDE, ALL).
- Conditional writes?Write only if condition holds (optimistic locking with version attribute).
- Batch operations?BatchGetItem (100 items) and BatchWriteItem (25 items); handle UnprocessedItems.
- TransactWriteItems?ACID transactions across up to 100 items.
- Calculate RCUs: 10 strongly consistent reads/s of 6 KB items?Each read = 2 RCU (round up 6 KB to 8 KB ÷ 4 KB) → 20 RCU.
- Calculate WCUs: 5 writes/s of 2.5 KB items?Each write = 3 WCU (round up to 3 KB) → 15 WCU.
- ProjectionExpression?Return only specific attributes to reduce data transfer.