Module 5 · Lecture 20

Project Presentations II & Course Wrap-Up

The remaining teams present — then the whole arc pulled into one portable decision framework

⏱ 90 minutes 🎤 5 teams · 10 min + 3 min Q&A 🧭 Synthesis: Lectures 11–18 in one framework 📍 Prerequisites: Lecture 19 (brief, rubric, run sheet)

Contents

  1. Learning Objectives
  2. Session Timeline
  3. Run Sheet for the Remaining Teams
  4. The Arc of the Course
  5. The Decision Framework — The Most Portable Asset
  6. Compute-on-Read vs Compute-on-Write
  7. Polyglot Persistence — The Mature Answer
  8. What You Can Now Do
  9. Where to Go Next
  10. Key Takeaways

Learning Objectives

Session Timeline

Continuing the worked example of a ten-team cohort: teams 6–10 present today. Slots are shorter than in Lecture 19 — thirteen minutes rather than seventeen — because the final twenty-three minutes belong to the synthesis. The lecturer adjusts slot length to the actual cohort size.

TimeSegmentActivity
0–2 minOpeningTiming change announced; peer forms distributed
2–15 minTeam 610 min presentation + 3 min Q&A
15–28 minTeam 710 min presentation + 3 min Q&A
28–41 minTeam 810 min presentation + 3 min Q&A
41–54 minTeam 910 min presentation + 3 min Q&A
54–67 minTeam 1010 min presentation + 3 min Q&A
67–72 minCross-Team DebriefPatterns across all ten projects: what worked, what repeated
72–84 minCourse SynthesisFamilies, the decision framework, compute-on-read vs compute-on-write, polyglot persistence
84–90 minWhere to Go Next & CloseCertifications, the deepest remaining skill, the frontier, the closing argument

Section 1: Run Sheet for the Remaining Teams

Everything from Lecture 19 still applies — the rubric is unchanged, the peer form is unchanged, the demo-hygiene rules are unchanged. Three things differ.

Lecture 19Lecture 20What to Do About It
Presentation12 minutes10 minutesCut two slides now, not on the day. Merge the two Data slides and trim the demo to two questions
Q&A5 minutes3 minutesExpect two questions, not four. Answer the one asked, not the one you rehearsed
ChangeoverWithin the slotWithin the slotSet up during the previous team's Q&A — with a shorter slot there is no slack at all

If you were scheduled into Lecture 20 you have had an extra week and two fewer minutes. That is a fair trade and the rubric does not adjust for it. The slide to cut is almost always a second architecture slide or a third dashboard view — never the recommendation, and never the limitations.

Cross-Team Debrief — Five Minutes, Everyone

Before the synthesis, the room answers three questions aloud. These are not rhetorical; they are the fastest learning available in the whole module, because ten teams have just run ten independent experiments on the same brief.

  1. Which modelling decision did the most work? Across ten projects, which single embed-or-reference call — or which key design — bought the most, and why?
  2. Which recommendation would you fund? If you had one budget line, whose project gets it? Say why in one sentence.
  3. What did everybody get wrong? The failure that recurred across teams is the one worth naming out loud, because it is a property of the brief, not of any one team.

Section 2: The Arc of the Course

Ten sessions ago the question was "why would anyone use anything other than a relational database?" Everything since has been an answer to it. The table below is the course in one view: each family, the class of business question it answers best, and where you met it.

Family / ToolThe Business Question It Answers BestWhy It Wins ThereTaught In
Relational (SQL) "Is this ledger correct, and can I prove it?" Enforced schema, multi-table transactions, mature reporting — correctness as the first-class guarantee Lectures 1–10
Document — MongoDB "Our records have different shapes and the analysts need to query any field. What do we store them in?" Flexible shape, nested data stored as the application uses it, secondary indexes on anything Lectures 12–16
Key-value — Redis "What is happening right now, and can the page render it in under ten milliseconds?" In-memory, O(1) lookups, purpose-built structures for counters, rankings, uniqueness and presence Lectures 17–18
Column-family — Cassandra "We ingest a million sensor readings a minute. Where do they land?" Linear write scale-out, aggregation over single attributes without reading whole rows Lecture 11 (survey)
Graph — Neo4j "Which claimants are connected to each other through shared addresses and garages?" Traversal cost depends on the neighbourhood, not the dataset size — where SQL self-joins collapse Lecture 11 (survey)

And the Skills Layered on Top

SkillWhat It Let You DoTaught In
CRUD and query operatorsAsk the database a precise question instead of pulling everything and filtering in codeLecture 13
Indexes and explain()Tell the difference between "the database is slow" and "we never indexed the field we filter on"Lecture 14
The aggregation pipelineTurn 15,000 raw bookings into a completion rate, an hourly failure curve, and a revenue-leak estimate — and know that the $match stage imposing a volume floor is what stops a 46-booking hour topping the rankingLecture 14
Atlas ChartsPut the answer in front of someone who will never open a shellLectures 15–16
Dashboard storytellingOrder the charts so the conclusion is unavoidable rather than merely availableLecture 16
Compute-on-write architectureServe a live dashboard in single-digit milliseconds by paying the cost at ingestLecture 18

One dataset held it all together. bdma.rides — 15,000 Delhi NCR bookings — was modelled in Lecture 12, queried in 13, aggregated and indexed in 14, charted in 15–16, and re-architected onto Redis counters in 17–18. The same 62.29% completion rate, 17.99% driver-cancellation rate and ₹13,33,539 revenue-leak estimate arrived by two completely different engineering routes. That is the point of Section 4.

Section 3: The Decision Framework — The Most Portable Asset

You will forget the syntax. Within a year you will not remember the exact stage order of a pipeline or the argument order of ZADD, and that is fine — both are a search away. What should survive is the framework, because it is what you will actually be paid to apply. It is five questions, in this order, and it was first stated in Lecture 11 before you had the experience to see why each one matters.

1

What is the access pattern? Write down the three queries the system will run most often, before naming any technology. Where you saw it: in Lecture 12 the embed-versus-reference decision was not a matter of taste — it was decided by whether ride and driver data were read together. In Lecture 18 the entire Redis key schema was derived from one sentence: "the dashboard asks for today's totals every five seconds."

2

What does a stale read cost? A rupee, or a slightly out-of-date view count? Where you saw it: the Redis dashboard in Lecture 18 serves numbers that may be milliseconds behind the write — entirely acceptable for an operations screen, and entirely unacceptable if the same number drove a driver payout. Same data, different tolerance, different store.

3

How fast does the schema change? Monthly change favours a document model; a schema untouched for three years favours relational. Where you saw it: adding a cancellation_reason field to some ride documents and not others took no migration in Lecture 13. The same change on a 15-million-row SQL table is a planned release with a rollback plan.

4

What is the realistic volume in three years? Be honest, and multiply by a sane growth rate rather than an ambitious one. Where you saw it: 15,000 documents fit in the free M0 tier with room to spare. Most business systems never leave single-server territory — and adopting a distributed database you do not need imports operational complexity you will certainly pay for.

5

Who operates it at 3 a.m.? The best database for a team that cannot run it is the wrong database. Where you saw it: every lab in this course ran on Atlas — a managed service — precisely so that none of you had to configure a replica set. That convenience is a real, recurring cost line, and it is almost always worth paying.

How to use this in a meeting. When a vendor or an enthusiastic engineer proposes a technology, you do not need to know the technology. You need to ask questions 1 and 2 and watch what happens. If nobody in the room can state the three most frequent queries, the decision is being made on fashion, and your job is to send it back until the access pattern is written down. Forcing the pattern to be stated before the technology is chosen is the whole job.

Section 4: Compute-on-Read vs Compute-on-Write

If you remember one engineering idea from Lectures 14 to 18, make it this one. It is not a MongoDB-versus-Redis question — it recurs in data warehouses, caching layers, materialised views, and every reporting system you will ever commission.

Every derived number — a completion rate, a daily total, a leaderboard position — is computed at one of two moments: when someone asks for it, or when the underlying event happens. That choice determines your latency, your flexibility, and the cost of every new question.

The Same Number, Two Ways

In Lecture 14 you computed the completion rate with an aggregation pipeline: scan the matching documents, group, divide. The database did the work at the moment you asked, and the answer reflected every document written up to that instant.

// Compute-on-read — MongoDB, Lecture 14
db.rides.aggregate([
  { $match: { booking_date: { $gte: ISODate("2024-01-01") } } },
  { $group: { _id: "$status", n: { $sum: 1 } } }
])
// Cost paid: at query time, every time. Any new question is free.

In Lecture 18 you computed the same rate differently: every ride, as it was written, incremented a small set of Redis counters. The dashboard then performed no computation at all — it read four integers.

// Compute-on-write — Redis, Lecture 18
INCR  rides:2024-06-14:total
INCR  rides:2024-06-14:status:completed
HINCRBY rides:2024-06-14:byhour 18 1
// Cost paid: once per event. Reads are O(1) — and only for questions you anticipated.
Compute-on-Read (MongoDB aggregation)Compute-on-Write (Redis counters)
When the work happensAt query time, on every requestOnce, at ingest
Read latencyTens of milliseconds to seconds, scaling with data volumeSub-millisecond, flat regardless of history
Write costOne insertOne insert plus N counter updates
A brand-new questionFree. Write a new pipeline and run it against existing dataExpensive. New key, new write-path code, and a backfill over history
Correcting bad dataFix the documents; every future query is correct automaticallyFix the documents and recompute every derived counter
StorageRaw data onlyRaw data plus every pre-computed aggregate
Right forExploration, ad-hoc analysis, monthly reporting, anything where the questions are still movingLive dashboards, leaderboards, rate limits, counters on a page rendered thousands of times a second
Fails whenQuery volume is high and latency must be flatThe questions change faster than you can ship write-path code

The decision rule. Compute on read until read latency or query volume makes it untenable — then move only the specific, stable, high-traffic questions to compute-on-write. Pre-computing an aggregate is a commitment: you are betting that this question will still be asked next year. Teams that pre-compute everything up front build a system that is fast at answering last quarter's questions and incapable of answering this quarter's.

The Hybrid, Which Is What Real Systems Do

  1. Every ride is written to MongoDB as the system of record — complete, correctable, and queryable on any field.
  2. The same write path increments a handful of Redis counters for the five numbers the live dashboard needs.
  3. The operations screen reads Redis and renders instantly.
  4. Analysts run aggregation pipelines against MongoDB for anything the counters do not cover, which is most new questions.
  5. A nightly job recomputes the Redis counters from MongoDB, so drift and missed increments are corrected within a day.

Step 5 is the one teams forget, and it is what makes the architecture survivable. Derived data drifts. If there is no path back to the source of truth, the dashboard slowly becomes confidently wrong — which is worse than being slow.

Section 5: Polyglot Persistence — The Mature Answer

Lecture 11 ended on the claim that most large organisations run several databases. Having now built on two of them, you can see why that is engineering rather than indecision. A single ride-hailing business might reasonably run:

WorkloadStoreThe Property That Decided It
Driver payouts and invoicesPostgreSQLMulti-row transactions and auditability — a stale read costs real money
Ride records and analyticsMongoDBShape varies by product line; analysts query any field ad hoc
Live surge and ops dashboardRedisSub-millisecond reads on a page refreshed every few seconds
Sensor and telemetry ingestCassandraSustained write throughput beyond a single node
Fraud ring detectionNeo4jMulti-hop traversal that SQL self-joins cannot do at depth

The honest cost, which vendors omit. Every additional store is another thing to back up, monitor, patch, secure, capacity-plan, and hire for — and the data between them must be kept consistent by application code that nobody enjoys writing. Polyglot persistence is correct when each store is carrying a genuinely different access pattern, and it is an expensive mistake when it is three databases doing one job because three teams each had a preference. The test is question 5 of the framework: who operates it at 3 a.m.? Two stores run well beat five run badly.

Section 6: What You Can Now Do

Not "appreciate" or "be aware of". These are things you can sit down and do, and they are the honest output of ten sessions.

CapabilityConcretely
Size an Atlas cluster for a known workloadEstimate document size and count, project three-year growth, work out the working-set memory requirement, and say which tier it needs and why
Read an explain() planIdentify COLLSCAN versus IXSCAN, compare totalDocsExamined against nReturned, and state whether an index is being used and whether it is the right one
Design a compound index that obeys ESREquality fields first, Sort fields second, Range fields last — and explain to an engineer why their field order is costing a sort in memory
Make the embed-versus-reference callDecide from access pattern, document growth, and update frequency — and say what would have to change for the other answer to win
Write a multi-stage aggregation pipeline$match early, $group, $unwind, $lookup, $sort, $project — and order the stages so the expensive ones see the fewest documents, with a volume floor before any ranking by rate
Design a Redis key schemaName keys by a consistent convention, pick the structure for the property you need, set TTLs deliberately, and estimate memory before you ship
Build a dashboard that survives a strangerHeadline metric, then the driver, then the detail — with units on every axis, denominators beside every percentage, and no rate ranked without the volume behind it
Turn a finding into a funded recommendationQuantify the problem, propose a specific action, estimate the return against the cost, and design the test that would prove it
Challenge a vendor who says their database needs no schemaReply that the schema has moved into the application, ask who validates it there, and ask what happens on the day two services disagree about a field's type
Recognise when NoSQL is the wrong answerStable schema, single-server volume, transactional correctness, a team fluent in SQL — recommend PostgreSQL and be right

The last row is the one that matters most. A manager who can only recommend the new thing is not more useful than one who can only recommend the old thing. The value is in the discrimination — and recommending the boring, well-understood option when it fits is a senior move, not a timid one.

Section 7: Where to Go Next

Certifications Worth the Time

PathWhat It CoversWhy Bother
MongoDB University — Associate DeveloperCRUD, indexing, aggregation, data modelling, driver usage. Free courses; the exam carries a fee, with student discounts availableIt is the natural next step from this course — roughly 70% of the syllabus is material you have already covered, and the remainder is drivers and deployment
MongoDB University — Associate Database AdministratorReplica sets, sharding, backup, security, performance tuningTake this instead if you are heading toward platform or infrastructure work rather than application development
Redis UniversityFree, self-paced: RU101 for the data structures, then streams, search, and JSON modulesLecture 17 covered perhaps a third of Redis. Streams and the search module are both worth a weekend

The Deepest Remaining Skill — The Aggregation Pipeline

If you pursue one technical thing further, make it the aggregation framework. Lecture 14 covered the stages you need most often; the framework has roughly thirty more, and the ones that reward study are $facet (several independent aggregations over one pass of the data, which is how a multi-panel dashboard is built efficiently), $bucket and $bucketAuto for distribution analysis, $graphLookup for recursive hierarchies, and the window functions $setWindowFields added in version 5.0 for running totals and moving averages. It is the single highest-leverage skill in the MongoDB ecosystem, because almost every reporting requirement reduces to a pipeline.

The Current Frontier — Vector Search in Atlas

The most significant recent change in this space is that document databases have absorbed vector search. Atlas Vector Search lets you store an embedding — a numeric array representing the meaning of a piece of text or an image — in an ordinary field alongside the rest of the document, index it, and query by semantic similarity rather than by exact match. The practical consequence is that a retrieval-augmented generation system, which until recently required a separate specialised vector database alongside your operational one, can now run on the store you already operate. That matters commercially far more than it matters technically: it removes a system from the architecture, and by question 5 of the framework, removing a system is usually worth more than any feature you would gain by adding one. Treat it as a strong default to evaluate rather than a settled answer — the dedicated vector databases remain faster at very large scale, and the honest version of this recommendation is that most organisations never reach that scale.

Keep These Pages

This site stays up. The pieces you are most likely to come back to:

Key Takeaways

✓ What You Should Be Able to Say After This Course

  1. There is no best database — only a best fit for a stated access pattern. Every technology comparison that does not begin with the access pattern is a comparison of marketing material.
  2. The five questions outlive the syntax. Access pattern, cost of staleness, rate of schema change, realistic three-year volume, and who operates it at 3 a.m. Apply them to technologies this course never mentioned.
  3. Every derived number is computed on read or on write. MongoDB aggregation is flexible and pays at query time; Redis counters are instant and pay at ingest. Move a question to compute-on-write only once it is stable and expensive.
  4. Pre-computation is a commitment, not an optimisation. And derived data needs a scheduled path back to the source of truth, or it drifts into being confidently wrong.
  5. Polyglot persistence is normal and not free. Each store earns its place by carrying a different access pattern — two run well beat five run badly.
  6. Your job is to force the access pattern to be stated before the technology is chosen. You will rarely write the migration. You will frequently be the person in the room who can insist the question is answered first.

→ That's the course. Thank you.

Ten sessions ago the proposition was that relational databases had met a class of problem they served badly. You have now modelled one dataset five ways, indexed it, aggregated it, charted it, re-architected it onto counters, and defended a recommendation built on it in front of a sceptical room. Keep the framework; look the syntax up. If you take one habit from this course, take the habit of asking "what are the three queries this system will run most often?" before anyone names a product — and notice how often nobody has written them down. That gap is where your value is. Good luck with the projects, and with the meetings.