CSE Roadmap

Core tier · about 2 hours · 6 parts

Part 6 of 6 · 4 min read

Exercises

Easy

Easy 1: Order the four questions (10 minutes)

List the four questions from this page in the order they should be asked when choosing a database for a new workload.

Done when: your order is consistency needs, then scale, then query patterns, then team and operational cost.

Hint

consistency decides what is even safe to build on; everything after it is comparatively adjustable.

Easy 2: Classify a workload's consistency need (10 minutes)

A workload tracks how many times a help article was marked "helpful." Does this need strong consistency or can it tolerate eventual consistency, and why?

Done when: you classify it as tolerating eventual consistency, since a brief undercount or overcount causes no real harm.

Hint

a helpfulness counter being briefly off by one or two causes no real harm to anyone.

Easy 3: Spot an unjustified scale decision (10 minutes)

A team with 50,000 total customer rows decides to shard their customer table across five machines before launch. What is wrong with this decision?

Done when: you explain that 50,000 rows fits comfortably on a single machine, so sharding adds complexity with no real scale justification yet.

Hint

50,000 rows is well within what a single ordinary machine handles easily, so the added complexity buys nothing yet.

Medium

Medium 1: Match a pattern to a storage family (20 minutes)

A workload needs to find all products frequently bought together with a given product, traversing a "bought with" relationship that can go several hops deep. Which storage family fits, and why?

Done when: you name a graph database and explain that deep, variable-depth relationship traversal is exactly its native pattern.

Hint

multi-hop "bought with" traversal is the textbook case for a graph database's native strength over relational joins.

Medium 2: Weigh operational cost against technical fit (20 minutes)

A team already runs MongoDB well and needs a moderate-volume key-value cache for session data. MongoDB can serve this reasonably, but a dedicated key-value store would be technically faster. Argue for one choice.

Done when: you make a reasoned case either way, explicitly weighing the dedicated store's speed advantage against the added operational cost of running a second system.

Hint

there is no single right answer here; the point is weighing real numbers, speed gained versus a second system's operational burden.

Medium 3: Apply the framework end to end on a small case (25 minutes)

A workload logs sensor readings from 10,000 devices once per minute, queried mostly as "average reading per device over the last 24 hours." Walk through all four questions for this workload.

Done when: you address consistency (tolerant of brief staleness), scale (moderate but steadily growing, time-ordered), pattern (time-range aggregation, pointing at a time-series-friendly design), and team cost (whether a dedicated time-series database is worth it at this volume).

Hint

time-ordered data queried by time-range aggregation is exactly the profile a time-series-oriented design is built for, at the right scale.

Hard

Hard 1: Catch a consistency mistake before it ships (25 minutes)

A team proposes storing event-ticket seat reservations in an eventually consistent, leaderless key-value store to maximize write throughput during an on-sale rush. Explain what could go wrong, and what the framework says to check first.

Done when: you explain that two customers could both be told they reserved the same seat under eventual consistency, and that this is exactly the kind of consistency need that should have been settled before scale or throughput was even considered.

Hint

a leaderless, eventually consistent store offers no protection against two conflicting reservations landing on the same seat, which is a consistency need, not a scale or pattern one.

Hard 2: Resolve a conflict between scale and pattern (25 minutes)

A workload's dominant pattern, deep graph traversal, points at a graph database, but its scale, billions of edges updated continuously, exceeds what the team's available graph database can comfortably handle. Propose how to navigate this conflict.

Done when: you propose a concrete resolution, such as a more scalable but less graph-native alternative with a denormalized adjacency structure, or partitioning the graph, and explain the trade-off accepted either way.

Hint

when scale conflicts with pattern, consider a compromise design, denormalized adjacency lists on a scalable store, or partitioning the graph itself, and name what is given up either way.

Hard 3: Justify a consolidation decision with a stated limit (25 minutes)

A team decides to keep using their existing relational database's JSONB support for a moderately flexible document-shaped feature, rather than introducing a dedicated document database. Write the one condition that should make them revisit this decision later.

Done when: your stated condition names a concrete future signal, such as that feature's own query volume, document complexity, or team's dedicated-document needs clearly outgrowing what the relational database's JSONB support comfortably handles.

Hint

name a specific, checkable future trigger, such as a measured query-latency threshold or document complexity growing past what JSONB handles well, rather than a vague "if it gets big."