(smollerGraph)

smollerGraph: Building smollerGraph: A Graph Database from Scratch

A graph database, from the bytes up.

We're going to build a small graph database from scratch in C++: how it keeps nodes and relationships on disk, how it follows them from one to the next, and how a Cypher query becomes a plan that runs, measured against Neo4j and Kùzu, on the way to a knowledge graph that mvGPT can ask for facts.

  1. (pages)
  2. (records)
  3. (hops)
  4. (cypher)
  5. (plans)
  6. (transactions)
  7. (knowledge)

Watch the seriesRead the codeAbout

Down the food chain, two hops from the red fox
MATCH (:Animal {name: 'Red fox'})
      -[:EATS*2]->(food)
RETURN food.name
food.name
"Clover"
"Wheat"

Episodes

  1. How graph databases work: Neo4j and Kùzu

    Before we build one in C++, why graphs, where the series is heading, and how Neo4j and Kùzu store a graph and run a query.

    33 min

  2. Graph database in C++: pages on disk

    The graph moves from memory into files of 4 KiB pages, with fixed-size records for nodes and relationships, so it outlives the program.

    29 min

  3. Graph database benchmark: Neo4j vs Kùzu

    A first benchmark on a million relationships, with the same two-hop question asked of smollerGraph, Neo4j and Kùzu.

    20 min

  4. Graph visualization in the browser with D3.js

    cpplint, clang-tidy and Abseil's Status for smollerGraph, then a UI, with sg serve answering HTTP and a page that draws the graph with D3, walks it a hop at a time, and shows each node's record on disk.

    49 min

  5. Database buffer pool in C++: keeping pages in memory

    A buffer pool for smollerGraph, with frames, a page table, pins, dirty pages and the clock, and what it does to a million relationships.

    22 min