A single table stores a customer profile, orders, and payment history.
Retrieve all items for one customer with a key-based Query and distinguish each item type.
Which design is most appropriate?
Share a customer partition key and encode entity type and time in the sort key so the item collection can be queried efficiently.
Detailed explanation
TTL is an expiration timestamp and does not group related items.
TTL is an expiration timestamp and does not group related items.
Items for the customer form an item collection and can be ordered or filtered by sort-key prefixes.
Items for the customer form an item collection and can be ordered or filtered by sort-key prefixes.
Per-customer tables increase operational overhead and make access management difficult.
Per-customer tables increase operational overhead and make access management difficult.
DynamoDB items require a primary key, and the requested Query cannot be expressed.
DynamoDB items require a primary key, and the requested Query cannot be expressed.
Check official documentation
Compare the following points with the official documentation.
Amazon DynamoDB item collections、single-table design、Query key conditionの公式説明を確認する。
What to confirm
PK共有によるitem collectionと、テーブル分割・Scan依存の違いを説明できる。
Key points
- Item collection
- PK/SK
- Single-table design
- Query
Notes
- Environment: AWS公式DEA-C01試験ガイドと各サービスの公式ドキュメントの確認
- Confirm current AWS service behavior in the official DEA-C01 documentation.
Foundation review
Key prefixes
Prefixes in a sort key can distinguish entity types while retaining a time or identifier order.
Hot partitions
High concentration on one partition key can require measurements or a sharding strategy.