Back to roadmap
Module 7 · NoSQL, Search, Graph, ObjectDay 06020 min

Key-Value Stores

Fastest possible lookups when keys are everything.

Day 060

Key-Value Stores

App
service
KV
datastore
Partition
datastore
Sort key range
datastore
Signal path
KV access patterns
App
service
flow
KV
datastore
KV
datastore
flow
Partition
datastore
Partition
datastore
flow
Sort key range
datastore
Memory hook

Key-Value Stores: fastest possible lookups when keys are everything

Mental model

match the datastore to the access pattern

Design lens

KV doesn't do range queries on values.

Recall anchors
ImplementationsConcerns

Why it matters

Key-value stores trade query power for speed. DynamoDB scales globally with predictable latency; Redis pairs KV with rich data structures; Memcached is the classic in-memory cache.

Deep dive

Composite keys (partition + sort) cover many access patterns.

Single-table design: cram entities into one DynamoDB table by carefully designing keys.

Hot partitions are the failure mode; spread by key prefix or write sharding.

Demo / scenario

Session store with 1M concurrent users.

  1. Key: session_id. Value: blob.
  2. Redis cluster: sub-ms reads.
  3. TTL on keys for auto-expiry.
  4. Memory bounded to active sessions.

Tradeoffs

  • KV doesn't do range queries on values.
  • Hot keys hurt — spread or replicate.
  • Redis durability options differ from DynamoDB.

Diagram

App
KV
Partition
Sort key range
KV access patterns.

Mind map

Check yourself

Loading quiz…

Sources & further reading