- Amazon DynamoDB scales horizontally (using data partition/sharding) and can seamlessly scale a single table over hundreds of servers.
- DynamoDB is schemaless.
- When you create a table in DynamoDB, you specify only the primary key attributes, such as partition key or partition key and sort key. You do not define any other attributes in advance.
Concept | Description |
---|---|
Partition | A partition is an allocation of storage for a table, backed by solid state drives (SSDs) and automatically replicated across multiple Availability Zones within an AWS Region. |
Partition key | DynamoDB uses the value of the partition key as input to an internal hash function. - Hence it must be specified in both read and write operations. |
Primary Key | When you create a table, in addition to the table name, you must specify the primary key of the table. - The primary key uniquely identifies each item in the table, so that no two items can have the same key. |
Primary Key type | Description |
---|---|
⭐ Composite Primary Key - Partition key and sort key | All items with the same partition key value are stored together, in sorted order by sort key value. - This helps in querying items more efficiently. |
Partition key only | We can only use partition key as primary key (must be specified in both read and write operations). |
- Choosing the Right DynamoDB Partition Key
- Best practices for designing and using partition keys effectively
- NoSQL design for DynamoDB
- Choosing the right number of shards for your large-scale Amazon DynamoDB table
- A Deep Dive into DynamoDB Partitions
- Everything you need to know about DynamoDB Partitions