smollerGraph is a series where I build a graph database from scratch in C++, a small one that you can read, run and understand from one end to the other. The focus is on what happens behind the query: how nodes and relationships are laid out on disk, how a database follows them from one to the next, how a Cypher pattern becomes a plan, and how indexes, transactions and a log keep it fast and correct.
Why graphs
Graphs are at the core of many of the problems we solve through engineering: knowledge graphs for search and AI, healthcare, routes and maps, file systems, distributed systems, batch jobs and ETL loads in the enterprise, the entities in a game engine, and cybersecurity, where tools such as BloodHound find attack paths through an organisation's accounts and machines.
Where it's heading
smollerGraph is heading towards a knowledge graph: facts kept as nodes and the relationships between them. It's going to get a browser UI of its own, which draws query results as a graph with D3. And at some point, it's going to meet mvGPT, the small GPT from the other series on the channel, which is going to ask it for facts.
Where it starts
The first episode looks at two graph databases in depth. Neo4j is a server written in Java, which keeps its graph as records that point at each other. Kùzu is an embedded database in C++, from research at the University of Waterloo, with columns and compressed sparse row adjacency. smollerGraph learns from both, and is measured against both as it grows, on queries such as those of LDBC's Social Network Benchmark.
Who it's for
It's for anyone curious about how a database works on the inside, in a codebase small enough to read. You don't need to have written a database before. Every change is typed out on screen, with the reasons behind it.
The code
The code is going to be on GitHub. Every step of every episode is a tag in the repository, so you can check out the code at any point in a video and run it yourself. Each episode's page lists its steps, with links to browse the code at each one and to see what changed since the step before.
Following along
New episodes go up on YouTube, and this site has an RSS feed for them.