NoSQL databases require designing schemas around access patterns, not around data relationships. Learn single-table design, partition key selection, and how to detect hot partitions before they kill your system.
Partition Key DesignSingle-Table DesignGSI / LSIHot Partition DetectionAccess Pattern First
Key Concepts
🗝️
Partition Key (Hash Key)
The primary distribution key. All items with the same partition key live on the same physical partition. A bad partition key (e.g., status="active") puts all writes on one shard and creates a hotspot.
📐
Single-Table Design
Store all entity types in one DynamoDB table, using composite sort keys to differentiate them. Avoids expensive joins. The PK/SK pattern encodes entity type: PK=USER#123, SK=PROFILE or SK=ORDER#456.
📇
Global Secondary Index (GSI)
An alternate partition key that projects a subset of attributes. Enables access patterns impossible on the base table. In DynamoDB, you specify the GSI partition key at write time; reads go to the index.
🔥
Adaptive Capacity
DynamoDB automatically shifts capacity to hot partitions up to 10× the provisioned baseline. But it's not infinite — design your partition key so no single partition gets more than ~3K RCU/sec in steady state.
Interactive Simulation — Partition Key Analyzer
Type a partition key pattern and see how traffic distributes across 10 partitions. Watch for hot partition warnings.
⚠️ HOT PARTITION DETECTED — This key pattern concentrates traffic. Consider adding a random suffix or using a composite key.
✅ Well distributed — Good partition key! Traffic is spread evenly across all partitions.