Database Engineering
Learn how to build a database engine, from the first row to recovery and concurrency.
Build toward a small database engine by following one shop’s products and orders. Begin with what a row means, trace a lookup in memory, then learn why files, pages, indexes, transactions, and recovery need their own machinery.
Start with the foundations
The opening lessons assume that you can follow a short program. They introduce SQL and systems terminology as it becomes useful. Examples include diagrams, a prediction question with a worked answer, and small code traces you can read without running anything.
The complete path now uses focused explanations: follow a concrete problem, trace its mechanism through actual values, and predict what changes in a second example. Foundations explain rows, bytes, pages, sorted search, and consistent reads before later lessons reuse them. Each rewritten chapter links to extended references for the original technical depth; read those when you want the additional mechanisms and qualifications.
Where the path leads
The first nine stages work toward a single-machine engine with clear behavior and evidence for its reliability. The final stage studies engines across machines. Reading alone does not establish production readiness; later implementation work must test failures, recovery, concurrency, and resource limits.
Use the learning path and source guide for the prerequisite map, university references, and implementation milestones. Roadmap.sh helps check topic coverage; original explanations connect the concepts here.
Reference material
Before you start
- Follow a short program with variables, loops, and functions
- No SQL or database-internals knowledge required for the opening lessons
Curriculum
What a database promises
A tiny engine in memory
Rows become bytes
Data exceeds memory
Finding rows efficiently
Executing queries
Surviving interruption
Overlapping transactions
Making the engine operable
- Separate time working from time waiting
- A queue cannot absorb an endless surplus
- Find the resource that fills up first
- Commit the order and remember to notify shipping
- Recover yesterday’s data after today’s mistake
- A valid user can still request the wrong row
- Change a stored field while old code still runs
- Find out where a slow commit waits
- Choose who owns the database process
- A purchase and a yearly report need different work
Engines across machines
- Send a request across a stream of bytes
- Retry a purchase without buying twice
- A silent server may still be running
- Which value may a later reader see?
- What reached the second copy before success?
- Keep one agreed history when a leader fails
- Find the owner of a key
- Agree whether both halves of a purchase commit
- Send partial totals instead of every row
- An old cache fill can arrive after an update
- Do not lose the update between loading and listening
- A new worker starts with an empty cache
- Decide which region may sell the last item
- A storage library does not choose a cluster leader
- What does a missing in-memory key mean?
- Follow a transaction through three system designs
- Trace one purchase through the engine you can build