How Databases Actually Work — Build One From a Text File

Every database you know — Postgres, MySQL, SQLite — grew out of one humble idea: a text file. In this video we start with users.txt and push it until it breaks, and watch indexes, a DBMS, the relational model, SQL, joins, and ACID emerge as the natural fix to each problem. This is Part 1 of a 5-part Databases series. No prior knowledge needed. ⏱️ Chapters 00:00 A file is already a database 00:26 Problem 1: search is too slow → indexes (BST → B-tree) 01:46 Problem 2: concurrent writes corrupt data → the DBMS 02:33 Problem 3: duplicated data → the relational model & foreign keys 04:19 Following a query (and a join) through the engine 05:49 Why SQL wins: ACID explained (atomicity, consistency, isolation, durability) 07:45 What comes next 📚 What you'll learn • Why a sorted file makes reads fast but writes slow — and how an index fixes both • How a B-tree index turns a million-row scan into 3–4 steps • Why app code should never touch the data file directly (the DBMS) • Foreign keys, the relational model, and how joins keep data clean • ACID, the write-ahead log, fsync, and row-level locks — explained simply 🎯 Who this is for Engineers and students who want to understand databases, not just memorize them. Plain language, built from the ground up. ▶️ Next in the series We design specialized databases from scratch — Redis, MongoDB, Cassandra, Neo4j — each born from a specific pressure point. Subscribe so you don't miss them. #Databases #SystemDesign #SQL #Postgres #SoftwareEngineering