Skill 1.3.4

Define Amazon DynamoDB keys and indexing

Key Concepts

A simple primary key is just a partition key. A composite primary key adds a sort key, so many items can share a partition key and be stored in sort-key order, which enables range queries such as all orders for a customer in a date range.

A local secondary index uses the same partition key with a different sort key, must be defined when the table is created, supports strongly consistent reads and limits each partition key's data to 10 GB. A global secondary index can use entirely different keys, can be added or removed at any time, has its own throughput and is eventually consistent. Each index chooses which attributes to project: keys only, selected attributes or all attributes.