Wide-Column and Graph Stores
A wide-column store arranges data by the queries it must serve, so the design starts from the access pattern rather than the entities. A graph store makes relationships first-class, which turns a chain of joins into a traversal.
What a learner can do afterwards
- Design a wide-column table starting from the query it must answer
- Express a friends-of-friends question as a traversal rather than repeated joins
- Say which questions a graph store answers cheaply and which it does not
1 · Read
You already know tables model entities and joins connect them. A wide-column store flips the starting point. You begin from the access pattern, the exact query the app must answer fast, and shape the table around it.
Your app must show one user's inbox in time order. So you build a table keyed by user, with that user's messages clustered by timestamp inside the row. The query reads one row and the inbox is already sorted.
A graph store makes relationships first-class instead. People and friendships are stored as nodes and edges, so a friends-of-friends question becomes a walk along edges. In SQL the same question needs a chain of joins, one per hop.
Pick the store by the question shape. Hop-by-hop neighbourhood questions are cheap in a graph, while questions that scan every node cost a lot. A graph buys cheap traversals and gives up cheap whole-store scans.
Wide-column tables start from the query, and graph stores turn join chains into cheap walks along edges.
2 · Watch
Take it off screen
Where it sits
This opens up
8 questions wait behind this lesson, each with its answer explained. Every answer feeds the sky: stars light as they are learned, and dim when it is time to come back.