โ˜๏ธAWSDVA Prep
← All cheat sheets
๐Ÿ—„๏ธ

DynamoDB

Development with AWS Services

Fully 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.
Test yourself on this โ†’