M0

Welcome to Modern Data Systems: CS145

Welcome to Modern Data Systems: CS145

What do you learn?

Twenty questions modern data systems answer Twenty course questions in four columns: AI agent data stacks, reads at scale, writes at scale, and trust, security, and streaming. Each question names the techniques the course uses to answer it. The grey line is the systems technique you will learn. DATA STACKS FOR AI AGENTS 1 One text prompt, many valid SQL queries. Your LLM picks one. How do you know it's correct? query ambiguity · unit tests · eval sets 2 Anthropic's text-to-SQL: 21% to 95% correct, no new model. What changed? grounding · knowledge model · governed metrics 3 An agent forgets every session. What do you store so it remembers? durable memory · SQLite · BM25 + vector retrieval 4 How do you find the nearest of a billion vectors, without a billion comparisons? vector index · HNSW · graph search 5 An agent re-reads the same long prompt every turn. How do you stop paying for it? KV cache · prefix reuse · paging READS AT SCALE · OLAP & ANALYTICS 6 How does Spotify search 100 million tracks without a scan? inverted index · term dictionary · B+Tree 7 What takes the same query from $550,000 a year to $400? index selection · IO cost model · big- data economics 8 How does 'scan a petabyte' become 'scan three columns'? columnar storage · Dremel · compression 9 How does Spotify Wrapped serve 700 million people in one day? precomputation · clustered index 10 How does Chrome check every URL you open without shipping the list? Bloom filter · hashing · false positives WRITES AT SCALE · OLTP & TRANSACTIONS 11 How does one Stripe charge become four writes, all or none? ACID · atomicity · two-phase locking 12 How do you absorb a billion writes a day without random seeks? LSM tree · MemTable · SSTables · compaction 13 How does one primary serve 800 million ChatGPT users? read replicas · replication lag · fan- out 14 When do you actually need to shard? Later than you think. sharding · one Postgres first · replicas 15 A transfer spans two shards. How do both commit, or neither? two-phase commit · coordinator failure TRUST, SECURITY & STREAMING 16 Every nightly job ran green and the numbers were wrong. How do you catch it? data quality · assertions · observability 17 Netflix released 'anonymous' ratings. How were the names put back? linkage attack · re-identification · differential privacy 18 One concatenated string lets an attacker run their own DROP. What stops it? SQL injection · parameterised queries · zero trust 19 A trillion messages a day, and a consumer can join years later. How? Kafka · append-only log · consumer offsets 20 How do you build storage out of drives you expect to fail? replication · commodity hardware · GFS CS145 · MODERN DATA SYSTEMS
CS145 starts with twenty production questions. Each answer introduces a systems technique you can reuse.
Notes ↗
Welcome to Modern Data Systems: CS145

Four eras of data systems, compared on the same four questions

Four eras of data systems, compared on the same four questions A four-column grid. The columns are Banks and retail in the 1970s to 1980s, the web from 1995 to 2010, the cloud era from 2004 onwards, and AI agents from 2025 onwards, the last one filled blue as the era the course is built for. Four rows compare them: the products of each era, who is on the other end of the query, the hard question each era had to answer, and what the industry invested in during it. The middle row escalates from hundreds of clerks, to millions reading, to billions writing at human pace, to machines at machine pace. The investments row runs from transactions and the relational model, through replicas and NoSQL and MapReduce, to LSM trees and object storage and columnar scans, to vector indexes and KV caches and lineage and Iceberg, the table format that lets any engine read the same storage. PRODUCTS WHO IS ON THE OTHER END THE HARD QUESTION INVESTMENTS Banks and retail 1970s TO 1980s Ledgers, inventory, airline seats Hundreds of clerks Is it correct? Transactions, ACID, the relational model, locking, write-ahead logs The web 1995 TO 2010 Google, Amazon Millions reading Can everyone read it at once? Replicas, caches, NoSQL, inverted indexes, the cluster, MapReduce The cloud 2004 ONWARDS Gmail, YouTube, Instagram Billions writing, at human pace Can everyone write and store forever? LSM trees, sharding, consistent hashing, object storage, quorums, columnar scans AI agents 2025 ONWARDS Copilots, agents, assistants Machines, at machine pace Machines read and write nonstop. Is all of it correct, and what did it cost? Vector indexes, KV caches, eval sets, lineage, Iceberg, lakehouses Each era stacks on the one before it. This course is built for the column on the right.
Each era shifted the party issuing the query. CS145 targets the agent era.
Notes ↗
Before You Start

What you need on day one, and what helps a lot

What you need on day one, and what helps a lot Three panels. The first, with an ink top strip marking it as required, is Python and Colab: read Python and run a notebook, needed from day one. The next two, with grey strips marking them as helpful rather than required, are CS 161 Algorithms, giving sort and hash and complexity, and CS 111 Systems, giving filesystems and the memory hierarchy and scheduling. A closing line says CS145 runs those same concepts on data 100 to 1,000,000 times bigger, and points at the ten-question concept check that opens PSET 0. WHAT YOU NEED REQUIRED Python and Colab Read Python, run a notebook, open a Colab and execute a cell. df.head() → [10 rows] HELPS A LOT CS 161 · Algorithms Sort, hash, complexity. How an operation scales when the input grows. Modules 2 and 3 lean on it. HELPS A LOT CS 111 · Systems Filesystems, the memory hierarchy, scheduling. Where the bytes actually live. Module 2 leans on it. CS145 takes those same concepts and runs them on data 100x to 1,000,000x bigger. PSET 0 opens with ten questions on exactly these concepts. Start there, and scan ahead when one finds a gap.
The course leans on the concepts from CS161 and CS111 more than the coursework. Use PSET 0 to check where you stand.
Notes ↗
How It Works

One week in CS145, and the eleven weeks it repeats across

One week in CS145, and the eleven weeks it repeats across Two blocks in one picture. The top block is one week in three lanes, read top to bottom in the order you do them. LECTURES holds the two lectures, Tuesday and Thursday. PRACTICE shows section slots on Wednesday and Friday running the same Colab walkthrough. Students pick one slot; timings are on Ed. READING holds the same page used in lecture with its three to five minute video, and the week's industry case study. Between them, a line says section and the reading are the rehearsal and the PSET is the same material on your own, graded. The bottom block is the quarter: eleven week columns with the module each covers, M1 SQL through M5 Distributed, a Thanksgiving gap at week ten and industry lessons at week eleven, then two rows of real deadlines. Six PSETs: M0 Sep 25, M1 Oct 5, M2 Oct 12, M3 Oct 19, M4 Nov 9, M5 Dec 2, each landing the week after its module ends. Three project milestones: Project 1 Oct 16, the Project 2 proposal Oct 30, and Project 2 Nov 20. ONE WEEK TUE WED THU FRI 1 LECTURES 2 PRACTICE 3 READING Lecture new material, live Lecture new material, live Section slots Wednesday PICK ONE Timings on Ed Section slots Friday The lecture page, in Notes plus a 3 to 5 minute video The week's reading list required pages, plus a case study Section and the reading are your prep for the PSET. It is the same material, on your own, graded. ELEVEN WEEKS The module underneath changes. The rhythm stays the same. W1W2W3 W4W5W6 W7W8W9 W10W11 M1 M1 M2 · M3 M3 M4 M4 M4 M5 M5 break Industry PSETS PSET M0Sep 25 PSET M1Oct 5 PSET M2Oct 12 PSET M3Oct 19 PSET M4Nov 9 PSET M5Dec 2 PROJECTS Project 1Oct 16 P2 proposalOct 30 Project 2Nov 20
Section and the reading are your prep for the graded PSET. Lectures run Tuesday and Thursday; pick one section slot (timings on Ed). The bottom block is that same week across all eleven: a PSET follows its module.
Notes ↗
How Grading Works

One hundred points: fifty fixed, and fifty you can earn two different ways

One hundred points: fifty fixed, and fifty you can earn two different ways A hundred-point scale. The first fifty points are fixed for everyone: Project 1 worth ten, PSets worth fifteen, Project 2 worth twenty-five. From the fifty-point mark the bar splits into two alternatives for the remaining fifty. Path 1 accrues fifteen points from nano quizzes and puts thirty-five on the final. Path 2 is a final worth fifty. A brace on the right marks that you are given whichever of the two scores higher, automatically. YOUR GRADE, OUT OF 100 0 50 100 FIXED FOR EVERYONE Project 1 10 PSets 15 Project 2 25 PATH 1 · ACCRUE POINTS FROM NANO QUIZZES Nano quizzes 15 Final 35 Final 50 PATH 2 · BET ON THE FINAL You get the higher score.
Everyone earns 50 fixed points: Project 1 for 10, PSets for 15, Project 2 for 25. The remaining 50 points come from either Path 1 or Path 2, and the course uses the higher score. Path 1 accrues 15 points from nano quizzes across the term and puts 35 on the final. Path 2 assigns all 50 to the final.
Notes ↗
AI Policy: Learn Like You'll Work

Where AI is allowed in CS145, and what is graded in each place

Where AI is allowed in CS145, and what is graded in each place Two panels. On the left, the projects: every AI tool is allowed, credited, and the grade is on four things you do after the model answers, namely verify the answer, fix the semantics, cut the cost, and defend the design. On the right, the paper test: no AI, standing in for a whiteboard interview and measuring the systems thinking you carry yourself. SHIP WITH AI, OWN THE RESULT On the projects Use any tool you like. Credit it. GPT, Claude, Gemini, whatever you prefer, to learn, brainstorm and debug. Get practice drafting the SQL yourself; the grade is on: Verify the answer is correct Fix the semantics Cut the cost Defend the design On the paper test No AI. This is the stand-in for the whiteboard job interview, so it measures the part that is now scarce: systems thinking you carry yourself. Query semantics, what the SQL does Performance debugging, why queries are slow Index strategy, when it helps or hurts Join algorithms, which one fits your data Tradeoffs: memory vs disk, latency vs throughput
On projects, draft your code first, then any AI tool and credit it; your grade is on verifying the answer, fixing the semantics, cutting cost, and defending the design. The paper test is AI-free, a stand-in for the whiteboard interview.
Notes ↗
Welcome to Modern Data Systems: CS145

Teaching Team

Shiva

ShivaInstructor · CS145 '94 · Teaching since 2018

Jason Hu

Jason HuHead CA · CS145 '24

Ananya GanapathiAnanya Ganapathi

Aryan KatiyarAryan Katiyar

Ganesh Venu

Ganesh VenuCS145 '25

Jason ShinJason Shin

Owen Jung

Owen JungCS145 '25

Qirui ZhengQirui Zheng

Yixiao Zhang

Yixiao ZhangCS145 '25

Yufei LiuYufei Liu

Notes ↗
M0

Why Memory Matters

Databases give applications durable memory: data survives after a computation ends.

What this course teaches

Five you learn, then the modern systems you build

Five you learn, then the modern systems you build Top row: five capability modules, from SQL and storage on one machine through indexing, transactions, and distributed systems across many machines. Below, M6 applies those mechanisms to phones, AI-agent memory, and modern data platforms. ONE MACHINE → MANY MACHINES M1 · SQL SELECT · COUNT(*) GROUP BY Declarative Postgres · BigQuery M2 · Storage disk pages On disk Chrome · Uber M3 · Indexing 1B rows → ms Spotify · OpenAI M4 · Transactions all-or-nothing Stripe · GitHub M5 · Distributed three shards Many machines Netflix · Kafka phone agent server M6 · Modern systems: the ones running now
Each module adds one capability, and each one supports the next scale.
Notes ↗

Three systems, reconstructed

Three systems, reconstructed Three blue cards run from one machine to many. Small analytics starts with Pandas in memory and Polars streaming supported work. Agent memory separates working context from persistent memory. UberEats coordinates shared transactional state across many machines and saves unfinished phone actions through network failures. 0.1 · Small analytics Pandas starts in memory. Polars can stream supported work. one machine the on-ramp 0.2 · Agent memory Working context plus persistent memory. local → global the whole course in one example 0.3 · A big service Shared transactional state, plus the disconnected edge. billions of database transactions planet scale and the edge one machine many machines
Three case studies move from working state on one machine to persistent state across many machines. Modules 1 through 6 explain the mechanisms underneath.
Notes ↗
M0

Pandas: Deconstructing Small Analytics

Pandas normally materializes a DataFrame in memory.

Pandas: Deconstructing Small Analytics

How Pandas holds a DataFrame

How Pandas holds a DataFrame Pandas reads listens.csv from disk into memory as a DataFrame with named, typed columns. The DataFrame stores each column in a typed array and materializes its data in memory. ON DISK listens.csv a CSV, or a Parquet file read IN MEMORY · A DataFrame user_id song_id rating int64 int64 int64 1 12 5 1 45 4 Held column by column Each column is one contiguous typed array, which is why summing one column is fast. user_id 1 1 song_id 12 45 rating 5 4 Pandas materializes the DataFrame in memory before these operations run.
A CSV on disk or a Parquet file reads into a DataFrame with named, typed columns. The system stores each column as its own typed array, which makes column aggregation fast. The DataFrame keeps every column of every row in memory at once, so it runs fast on small data and fails when the data exceeds memory.
Notes ↗
A familiar example

Pandas: the whole dataset has to fit in RAM

Pandas: the whole dataset has to fit in RAM Pandas reads a CSV or Parquet file into a DataFrame on one machine. Group, sort, and join operations use that machine's memory. As data and intermediate results approach the available RAM, the process may slow, swap, or fail an allocation. CSV / Parquet on disk read ONE MACHINE · RAM ≈ 16 GB DataFrame every row, one process, in memory group / sort / join all in RAM result handed back fast RAM limit data > RAM: slow, swap, or fail
Group, sort, and join execute in one process. As memory pressure grows, Pandas may slow sharply, swap, or fail an allocation. It does not automatically turn the operation into a streaming or distributed plan.
Notes ↗
Pandas, Polars, and a database

How far each engine gets on a data-size axis, and where one machine ends

How far each engine gets on a data-size axis, and where one machine ends An illustrative data-size axis compares three execution models. Pandas normally materializes data and intermediate results in memory. Polars can stream supported operations in batches on one machine, although some operations still materialize. A distributed database divides storage and execution across machines. Actual limits depend on the query and hardware. One machine is enough Needs many machines small Spotify laptop RAM one server's RAM one server's disk the real Spotify 1 GB 10 GB 100 GB 1 TB 10 TB 100 TB 1 PB Pandas DataFrame code out of RAM Polars stream supported operations Distributed database SQL Hardware you already own A cluster you rent
Pandas normally materializes the data and intermediate results in memory. Polars can stream supported operations in batches, which extends the range of one machine. Some operations still require materialization. A distributed engine divides storage and execution across machines when one machine no longer fits the workload.
Notes ↗
M0

Claude & OpenAI: Deconstructing Agent Memory

An LLM model only sees the context supplied for its current call.

Claude & OpenAI: Deconstructing Agent Memory

Agent memory from local retrieval to a global service

Agent memory from local retrieval to a global service Three panels left to right. A model call can miss an earlier decision when the current context does not contain it. A local agent can retrieve saved project evidence from SQLite. A global product can serve user memory from a replicated Postgres deployment supporting 800 million users. 1 · Current context Model context window Only this call 2 · Local memory Model SQL SQLite Saved across sessions 3 · Global memory Model SQL Postgres Shared across users
Context (or memory) lives outside the model. The current context is short-term working memory, limited to what a single call includes. A local agent persists saved evidence in an embedded database (SQLite on one machine) that survives every session. OpenAI reports a read-heavy Postgres deployment serving 800 million users, with one primary and nearly 50 read replicas.
Notes ↗
A new session can miss prior decisions

A plausible answer is still wrong

A plausible answer is still wrong On Tuesday you ask the agent to extend the auth module you built on Monday. The current request does not include the earlier decision, and the agent does not retrieve the relevant code. It predicts a plausible function named verifyJWTWithScope, but the codebase contains no such function. Tuesday: "extend the auth module we built on Monday." The agent guesses The earlier decision is absent. verifyJWTWithScope() A name that sounds exactly right. In your codebase Every function you actually wrote: no such function It never existed anywhere. Persistent memory gives a later call evidence it can retrieve.
Monday produced a working module. Tuesday's request does not contain the earlier decision. The agent generates verifyJWTWithScope() from patterns rather than retrieved evidence. Persistent memory gives the next session something to query.
Notes ↗

The context window is working memory

The context window is working memory Three model calls run left to right. The first context reaches its token limit. Later calls contain only the context the application supplies. A persistent database below the calls retains saved records, and retrieval selects which records return to a later context. Context working memory Session 1 Context limit Session 2 context supplied Session 3 context supplied Fresh context each call Persistent memory Saved across sessions
The context window stays bounded at roughly 200,000 to 1,000,000 tokens. Persistent memory can retain records outside that window across sessions. The application retrieves selected records when a later request needs them.
Notes ↗
Local memory: a database on your machine

Local memory: capture, store, retrieve

Local memory: capture, store, retrieve Local agent memory. A model captures records in SQLite on your machine. Keyword search uses FTS5. Vector search can use Chroma or sqlite-vec: claude-mem documents Chroma, while QMD uses sqlite-vec. Retrieved records return to the model through the retrieval arrow. 1 Model LLM + context window captures records sessions + summaries Local memory on your machine capture retrieve + rank 2 Keyword SQLite · FTS5 finds exact terms 3 Vector Chroma or sqlite-vec finds related meanings
Local memory captures records in SQLite and retrieves selected evidence into later context. The diagram shows FTS5 keyword search and Chroma or sqlite-vec for vector search. claude-mem documents an optional Chroma index; QMD uses sqlite-vec.
Notes ↗
Global memory: the same need, at scale

Global memory: one primary, nearly 50 read replicas

Global memory: one primary, nearly 50 read replicas ChatGPT users send writes to one PostgreSQL primary. The primary replicates changes to nearly 50 read replicas across regions. Read results return from the replicas to the users. This is a simplified view of OpenAI's reported read-heavy PostgreSQL deployment. ChatGPT users 800 million users Read-heavy workload Postgres primary Accepts writes Writes ~50 read replicas Across geographic regions Replicate Read results return to users
OpenAI reports one Azure PostgreSQL primary and nearly 50 read replicas supporting a read-heavy workload for 800 million users. The primary accepts writes and replicates changes across geographic regions; the read replicas serve queries and return results to users.
Notes ↗
Going deeper

Three retrieval signals feed combined fusion ranking

Three retrieval signals feed combined fusion ranking Three vertically stacked boxes show BM25 keyword matching, vector similarity, and graph ranking. Arrows connect each signal to a fourth box for combined fusion ranking, which merges ranked candidates, removes duplicates, and selects evidence for the next context. This illustrates a possible combined pipeline, not a claim that every tool uses all three signals. 1 BM25 Matches the words you used. “auth” → records containing auth 2 Vector similarity Finds related meaning. “login” → related auth records 3 Graph ranking Ranks code by its relationships. auth.ts ← imported by 40 files 4 Combined fusion ranking Merge the ranked candidates. Remove duplicates. Select the strongest evidence. Top records → next context
BM25 ranks stored text by term matches. Vector similarity ranks stored text by embedding distance, so "login" can match "auth." Graph ranking orders code definitions by their relationships to other definitions. The fourth box illustrates combined fusion ranking: merge ranked candidates, remove duplicates, and select evidence for the next context. This is a possible combined design; QMD and Aider do not necessarily use all three signals.
Notes ↗
M0

UberEats: Deconstructing a Big Service

UberEats must keep the diner, driver, and restaurant in agreement while the service runs across many machines.

UberEats: Deconstructing a Big Service

UberEats: shared state for three sides

UberEats: shared state for three sides A simplified model of a three-sided order. The diner, driver, and restaurant apps hold temporary state. A distributed transactional database coordinates the shared order, assignment, and inventory records. One transaction applies the related changes together. Green marks the persistent shared state; the apps hold only volatile state. Diner app volatile in-memory state Driver app volatile in-memory state Restaurant volatile in-memory state Distributed SQL database · persistent shared state TRANSACTION: place order → charge diner, assign one driver, decrement inventory. All of it, or none of it.
The client apps hold only temporary, volatile in-memory state. The green frame is the persistent shared state: a transactional database that coordinates the order, assignment, and inventory records across all three sides, so related changes apply together.
Notes ↗

One order. Three records. All or none.

One order. Three records. All or none. A simplified order transaction updates the payment, driver assignment, and inventory together. A successful order applies all three changes. A failed order leaves all three unchanged. The database also rejects a conflicting driver assignment so two competing updates cannot both finish successfully. One diner places one order ONE TRANSACTION DINER balance charged DRIVER exactly one assigned RESTAURANT inventory decremented COMMIT All three apply together. ANY ONE FAILS None of them do. Related changes apply together. A conflicting driver assignment cannot also finish.
One transaction updates the payment, driver assignment, and inventory together. A successful order applies all three changes. A failed order leaves all three unchanged. Competing driver updates cannot both finish successfully.
Notes ↗

The disconnected edge: save now, send later

The disconnected edge: save now, send later The driver app saves an unfinished action and its latest state to disk when the phone loses its connection. After reconnecting, the app sends queued actions to the server and updates its local state if the server returns a different result. Green marks the shared server state. DRIVER'S PHONE · offline Driver app queued actions on disk survive an app restart on reconnect: send queued actions update local state from the server Fulfillment service shared server state green = the shared server state the phone syncs back to
The driver app saves unfinished actions to disk so they survive an app restart. It sends the queued actions after reconnecting and updates its local state to match the server.
Notes ↗
M0

Projects

Projects

The project path: Project 1, then one of two Project 2 options

The project path: Project 1, then one of two Project 2 options Everyone does Project 1 (BigQuery's First Heist, solo, Sep 25 to Oct 16, 16 to 20 hours, blue) and builds decision-worthy SQL and scalable cloud analytics, then picks one Project 2 (Oct 16 to Nov 20, pairs by default with solo optional, about 40 hours per person for a Tier 93 project (about 8 hours a week over five weeks), with the Tier 100 capstone adding about 8 more): Science (NanoQuery, violet, SQL, semantic search, and text-to-SQL evaluation, an analysis combining tabular data with a knowledge base) or Systems (NanoMem, green, a search engine giving AI coding agents persistent memory that races real production tools). Each card lists focus, skills you build, and the portfolio story. Blue is the SQL foundation, violet is data science, green is systems. PROJECT 1 · SOLO Sep 25 – Oct 16 BigQuery's First Heist FOCUS Write decision-worthy SQL on a 500 MB+ public dataset. SKILLS YOU BUILD CTEs, subqueries, window functions, debug tables, cloud analytics PORTFOLIO 3 decision-worthy SQL answers on real cloud-scale data. 16–20 hrs THEN PICK ONE P2 · SCIENCE Oct 16 – Nov 20 NanoQuery FOCUS Connect tables and documents, query them, and visualize findings. SKILLS YOU BUILD SQL, semantic search, embeddings, and text-to-SQL evaluation PORTFOLIO An analysis combining tabular data with a knowledge base. ≈40 hrs/person (Tier 93) or solo OR P2 · SYSTEMS Oct 16 – Nov 20 NanoMem FOCUS Build a search engine that gives AI coding agents persistent memory. SKILLS YOU BUILD Inverted index + BM25, LSH vectors, hybrid retrieval, query planner PORTFOLIO A memory engine that races real production tools. ≈40 hrs/person (Tier 93) or solo
Notes ↗
What you'll build

Project 1 architecture: query a public dataset with SQL to answer questions

Project 1 architecture: query a public dataset with SQL to answer questions Left to right: a read-only public dataset in BigQuery (three or more tables such as posts, users, and comments, at least 500 MB, grey) is queried by the SQL you write in a Colab notebook (a code card shows a CTE with a RANK window function and a join). It produces a result table of decision-worthy answers, one row starred as the insight. Below, you hand-trace two paper debug tables to verify how the SQL executes. Blue is what you build; grey is the read-only data you query. A read-only public dataset, real SQL, one insight worth acting on. THE DATA read-only, in BigQuery postsid · user_id · score 41 · u12 · 8842 · u07 · 15 usersid · name · country u12 · Ada · USu07 · Lin · SG commentsid · post_id · body 91 · 41 · "nice" 3+ tables · ≥ 500 MB StackOverflow, NYC Taxi, GitHub… query YOUR SQL 10+ queries, written in a Colab notebook top_posters.sql WITH ranked AS ( SELECT user_id, COUNT(*) AS posts, RANK() OVER (ORDER BY COUNT(*) DESC) rk FROM posts GROUP BY user_id ) SELECT u.name, r.posts, r.rk FROM ranked r JOIN users u USING(user_id) WHERE r.rk <= 10; 3 JOINs 2 CTEs 2 correlated subqueries 3 window fns answer THE PAYOFF "Who are our power users?" namepostsrk Ada4,2101 ★ Lin3,8802 Ravi3,1023 ★ Insert your insight: why are they ranked #1? (+5) 3+ decision-worthy answers, stated in English, backed by SQL VERIFY ON PAPER postsrktie? 42101no Hand-trace how RANK breaks ties, and a correlated subquery, row by row. 2 debug tables blue = what you build · grey = the read-only data you query
Notes ↗
M0

CS145: Your Data Systems Journey

CS145: Your Data Systems Journey

CS145 career journey map

CS145 career journey map A left-to-right map. The two blue boxes are CS145 itself, the content in focus: the core curriculum with Project 1, then a Project 2 choice of the Science path or the Systems path, NanoMem. The grey box is what you keep learning beyond the course, out of focus here. The green box is where it leads, the careers the path opens. Color key: blue is CS145 content, green is where it leads, grey is beyond CS145. CS 145 CS145 core curriculum Core: SQL (+ Pandas, NoSQL) the query languages for data Project 1: SQL Mastery BigQuery, tens of GB Core: Systems Storage, indexes, query opt Core: Transactions ACID, then distributed: replication, sharding, CAP Project 2: pick one Science path Enrich, visualize, train an ML model Systems path: NanoMem Build a search engine for AI agent memory Beyond CS145 keep learning Analyst / Scientist skills Engineer skills Where it leads Data Analyst Data Scientist Backend Eng Platform Eng Founder / CTO Color key  blue = CS145 content  ·  green = where it leads  ·  grey = beyond CS145
Core database skills build toward a project path, and each path maps to the industry roles that use it.
Notes ↗
You'll read, debug, and write queries like this

One query, three parts

One query, three parts The power-users query has three parts. The first CTE counts distinct songs, distinct genres, and total listens per user. The second keeps users spanning at least three genres and ranks them into deciles by total listens. The final SELECT joins user names and returns the top decile. user_stats roll every listen up, per user COUNT(DISTINCT song_id), COUNT(*) GROUP BY user_id power_users keep 3+ genres, then rank by listens WHERE unique_genres >= 3 NTILE(10) OVER (ORDER BY ...) final SELECT join back to names, take the top JOIN users u ON p.user_id = ... WHERE p.decile = 1
A production SQL pattern: two CTEs compute per-user aggregates and a decile rank, then an outer SELECT joins names and filters to the top decile.
Notes ↗
From an event to an analytical result

Spotify: from a client event to analysis

Spotify: from a client event to analysis Three panels show Spotify's published data-platform path. Client software publishes typed events. Event delivery uses managed queues, anonymization pipelines, and streaming jobs. Scheduled workflows run in BigQuery, Flink, or Dataflow so teams can analyze the resulting data. Color key: blue is collection, grey is movement and processing, green is analysis. 1 · Client event A listener presses play the client emits an event Typed schema event name, fields, types 2 · Deliver and process Managed queues Pub/Sub carries the events Processing jobs anonymize and transform 3 · Run analysis Scheduled workflows BigQuery · Flink · Dataflow Analysis queries, metrics, decisions Color key  blue = collection  ·  grey = delivery and processing  ·  green = analysis
Spotify's published data platform collects typed client events, moves them through managed queues and processing jobs, and makes the resulting data available for analysis.
Notes ↗
end of lecture 1~32 min of figures
M0 Kickoff: three teardowns 1 of 25
▶ Y Notes □ keys

M0 Kickoff: three teardowns

Pandas on a laptop, agent memory, UberEats at planet scale · 25 figures · ~32 min · 1 lectures at this pace