๐๏ธ
DynamoDB
Development with AWS ServicesFully managed, serverless NoSQL key-value and document database.
Keys & indexes
- โธPartition key alone, or partition key + sort key (composite key).
- โธLSI: alternate sort key, same partition key, must be created at table creation, shares table throughput.
- โธGSI: alternate partition + sort key, own throughput, can be created/deleted anytime.
Capacity modes
- โธProvisioned: set RCU/WCU ahead of time, use Auto Scaling to adjust; cheaper for predictable workloads.
- โธOn-demand: pay-per-request, scales instantly; better for unpredictable/spiky traffic.
Consistency & performance
- โธEventually consistent reads (default, cheaper) vs strongly consistent reads (RequestConsistency, 2x cost).
- โธDAX (DynamoDB Accelerator): in-memory cache, microsecond reads, reduces read load โ for read-heavy workloads.
- โธHot partitions cause throttling โ fix with better key cardinality/distribution or write sharding.
Advanced features
- โธDynamoDB Streams: time-ordered change log of item-level modifications, consumed by Lambda for triggers/replication.
- โธConditional writes (e.g. attribute_not_exists) enforce atomic checks without a separate read.
- โธTransactWriteItems / TransactGetItems: all-or-nothing multi-item ACID transactions across tables.
- โธTTL: automatically expire/delete items based on a timestamp attribute, at no extra write cost.