The remaining teams present — then the whole arc pulled into one portable decision framework.
| Clock | Segment | Detail |
|---|---|---|
| 0–2 | Opening | Timing change; peer forms out |
| 02–15 | Team 6 | 10 min + 3 min Q&A |
| 15–28 | Team 7 | Set up during Team 6 Q&A |
| 28–41 | Team 8 | On deck |
| 41–54 | Team 9 | On deck |
| 54–67 | Team 10 | On deck |
| 67–72 | Cross-team debrief | Patterns across all ten projects |
| 72–84 | Course synthesis | Families · framework · the compute trade · polyglot |
| 84–90 | Next steps & close | Certifications, the frontier, the closing argument |
| Lecture 19 | Today | What to do | |
|---|---|---|---|
| Presentation | 12 min | 10 min | Cut two slides now. Merge the two Data slides; demo two questions, not three |
| Q&A | 5 min | 3 min | Expect two questions. Answer the one asked, not the one you rehearsed |
| Changeover | In slot | In slot | No slack at all — connect during the previous team's Q&A |
The recommendation and the limitations. The slide to lose is a second architecture view or a third dashboard panel. You had an extra week and two fewer minutes — the rubric does not adjust for either.
Same brief, ten independent attempts. This is the fastest learning available in the module — answer all three aloud.
Across ten projects, which single embed-or-reference call — or which key design — bought the most, and why?
One budget line. Whose project gets it? Defend it in one sentence.
A failure that recurred across teams is a property of the brief, not of any one team. Name it out loud.
| Family | The business question it answers best | Why it wins there | Taught in |
|---|---|---|---|
| Relational | "Is this ledger correct, and can I prove it?" | Enforced schema, multi-table transactions, correctness first | L1–10 |
| Document · MongoDB | "Our records have different shapes and analysts query any field." | Flexible shape, nested data stored as the app uses it | L12–16 |
| Key-value · Redis | "What is happening right now, in under 10 ms?" | In-memory, O(1), purpose-built counting and ranking structures | L17–18 |
| Column-family · Cassandra | "A million sensor readings a minute — where do they land?" | Linear write scale-out across nodes | L11 |
| Graph · Neo4j | "Which claimants connect through shared addresses and garages?" | Traversal cost tracks the neighbourhood, not the dataset | L11 |
bdma.rides — modelled in L12, queried in L13, aggregated in L14, charted in L15–16, re-architected in L17–18.You do not need to know the technology being proposed. Ask questions 1 and 2 and watch what happens. If nobody can state the three most frequent queries, the decision is being made on fashion — send it back.
| Question | The moment in this course |
|---|---|
| 1 · Access pattern | L12: embed vs reference was decided by whether rides and drivers are read together. L18: the whole key schema came from "the dashboard asks for today's totals every five seconds" |
| 2 · Cost of staleness | L18: counters may lag the write by milliseconds — fine for an ops screen, unacceptable if the same number drove a driver payout |
| 3 · Schema change | L13: adding cancellation_reason to some documents took no migration. On a 15-million-row SQL table it is a planned release with a rollback plan |
| 4 · Three-year volume | 15,000 documents fit M0 with room to spare. Most systems never leave single-server territory |
| 5 · Who operates it | Every lab ran on Atlas precisely so none of you configured a replica set. That convenience is a real, recurring, usually-worth-it cost |
db.rides.aggregate([
{ $match: { booking_date:
{ $gte: ISODate("2024-01-01") } } },
{ $group: { _id: "$status",
n: { $sum: 1 } } }
])
Work happens when someone asks. Any new question is free.
INCR rides:2024-06-14:total
INCR rides:2024-06-14:status:completed
HINCRBY rides:2024-06-14:byhour 18 1
Work happens at ingest. Reads are O(1) — for questions you anticipated.
| Compute-on-read | Compute-on-write | |
|---|---|---|
| Work happens | At query time, every request | Once, at ingest |
| Read latency | Tens of ms to seconds, scaling with volume | Sub-millisecond, flat regardless of history |
| A new question | Free — new pipeline, existing data | Expensive — new key, write-path code, backfill |
| Fixing bad data | Fix documents; future queries correct themselves | Fix documents and recompute every derived counter |
| Storage | Raw data only | Raw data plus every pre-computed aggregate |
| Right for | Exploration, ad-hoc analysis, monthly reporting | Live dashboards, leaderboards, rate limits, counters |
| Fails when | Query volume is high and latency must be flat | Questions change faster than you can ship code |
Derived data drifts. With no scheduled path back to the source of truth, the dashboard slowly becomes confidently wrong — which is worse than being slow.
| Workload | Store | The property that decided it |
|---|---|---|
| Driver payouts and invoices | PostgreSQL | Multi-row transactions; a stale read costs real money |
| Ride records and analytics | MongoDB | Shape varies by product line; ad-hoc queries on any field |
| Live surge and ops dashboard | Redis | Sub-millisecond reads on a constantly refreshed page |
| Sensor and telemetry ingest | Cassandra | Write throughput beyond a single node |
| Fraud ring detection | Neo4j | Multi-hop traversal SQL cannot do at depth |
Every store is another thing to back up, monitor, patch, secure, capacity-plan and hire for — with consistency maintained by application code nobody enjoys writing. Two stores run well beat five run badly.
| Capability | Concretely |
|---|---|
| Size an Atlas cluster | Estimate document size and count, project three-year growth, work out the working set, name the tier and defend it |
Read an explain() plan | Spot COLLSCAN vs IXSCAN, compare totalDocsExamined to nReturned, say whether the index is used and whether it is the right one |
| Design a compound index | Equality → Sort → Range, and explain to an engineer why their field order is costing an in-memory sort |
| Make the embed/reference call | Decide on access pattern, document growth and update frequency — and say what would flip the answer |
| Write a multi-stage pipeline | $match early, then $group, $unwind, $lookup, $sort, $project — expensive stages seeing fewest documents, and a volume floor before any ranking by rate |
| Capability | Concretely |
|---|---|
| Design a Redis key schema | Consistent naming, the structure chosen for the property you need, deliberate TTLs, memory estimated before shipping |
| Build a dashboard that survives a stranger | Headline → driver → detail, units on every axis, denominators beside every percentage, no rate ranked without its volume |
| Turn a finding into a funded recommendation | Quantify the problem, propose the action, estimate return against cost, design the test that proves it |
| Challenge "our database needs no schema" | The schema moved into the application. Who validates it there? What happens the day two services disagree about a field's type? |
| Recognise when NoSQL is the wrong answer | Stable schema, single-server volume, transactional correctness, a team fluent in SQL → recommend PostgreSQL and be right |
A manager who can only recommend the new thing is no more useful than one who can only recommend the old thing. The value is in the discrimination.
| Path | Covers | Why bother |
|---|---|---|
| MongoDB University — Associate Developer | CRUD, indexing, aggregation, modelling, drivers. Free courses, paid exam with student discounts | Roughly 70% is material you have already covered; the rest is drivers and deployment |
| MongoDB University — Associate DBA | Replica sets, sharding, backup, security, tuning | Take this instead if you are heading toward platform work |
| Redis University | RU101 for the data structures, then streams, search and JSON | Lecture 17 covered about a third of Redis. Streams are worth a weekend |
$facet for multi-panel dashboards in one pass, $bucket for distributions, $graphLookup for hierarchies, $setWindowFields for running totals and moving averages. Almost every reporting requirement reduces to a pipeline.
The most significant recent change in this space: Atlas Vector Search lets you store an embedding — a numeric array representing the meaning of text or an image — in an ordinary field alongside the rest of the document, index it, and query by semantic similarity rather than exact match.
A retrieval-augmented system that recently needed a separate specialised vector database can now run on the store you already operate. It removes a system from the architecture.
Dedicated vector databases remain faster at very large scale. Most organisations never reach that scale — so treat this as a strong default to evaluate, not a settled answer.
You will rarely write the migration. You will frequently be the person in the room who can insist the question is answered first.