← All labs03 · Storage choices

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.

Comparative playground

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.

Workload briefs
Leading fitKey–value
InspectingKey–value
Compare models ↓
01

Describe the workload

One primary query decides the first cut. Real products often use several stores for different jobs.

02 / Compare candidates

Which model fits this question?

Choose a family to inspect its path.
Decision signalKey–value leads this workload.

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.

Strong fit
A

Data shape & mutation

Choose a mutation to change this sample model.

B

Access path & load

Direct key route1 item~1 routing/index step in this model

One known identity leads to one item.

  1. 1Resolve key
  2. 2Read item
Illustrative work at 2K reads/s2K items inspected/sOperation counts are teaching estimates. They are not throughput, latency, or a cross-product benchmark.
Why it can fit

Key–value has a natural path for this primary access pattern.

Watch out for

Finding values by arbitrary fields needs another index or a scan.

Examples

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?

Your turn
Choose one answer