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.
Ce que l'enfant saura faire ensuite
- 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 · Lis
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 · Regarde
En anglaisSans écran
Où se situe ce sujet
À apprendre avant
Liens facultatifs
Ce sujet mène à
8 questions attendent derrière cette leçon, chacune avec sa réponse expliquée. Chaque réponse nourrit le ciel : les étoiles s'allument à mesure qu'elles sont apprises, et pâlissent quand vient le moment de revenir.
Commence ce sujet