Interactive systems lab / 03
Data Store Decision Lab.
The first database question is what the product must ask of its data. Change the query, then watch the fit change.
Start with the question your data must answer.
First move: Start with “User sessions.” Change the primary access pattern from an exact key to a field filter and watch the leading model change.
Describe the workload
One primary query decides the first cut. Real products often use several stores for different jobs.
Which model fits this question?
Key–value has a natural path for this primary access pattern.
A product can pair a transactional source of truth with an object store, cache, or search index for another access pattern.03 / Inspect the model
Key–value under this workload.
Simple keyed lookups and short-lived state.
Data shape & mutation
Choose a mutation to change this sample model.
Access path & load
One known identity leads to one item.
- 1Resolve key
- 2Read item
Key–value has a natural path for this primary access pattern.
Finding values by arbitrary fields needs another index or a scan.
Redis, Valkey, DynamoDB
Under the model
Access patterns decide the shape.
Exact keys, arbitrary filters, multi-hop relationships, similarity search, append-heavy history, and large blobs place different demands on storage. A database family can support several patterns, but the path it takes and the operational cost change.
Estimates count illustrative candidates, index steps, or partitions touched. They are deliberately not latency predictions. A real choice also tests durability, operational skill, pricing, indexes, consistency scope, and observed query plans.
- Compare indexed and unindexed filters on a million records.
- Increase traversal depth and watch graph fan-out.
- Try strict transactions with a media workload and inspect the tradeoff.
Lesson 03 / Check your understanding
Can you explain the result?
A key-value store holds sessions. You must search by an arbitrary value, with no secondary index. What happens?