Neo4j 00:00:01 Who is Ana's grandchild? Ana's family directory holds a million people. You want her grandchildren, not every person whose surname happens to match. Neo4j can start with a specific node and follow relationships with a chosen type and direction. Five people, three parent links and two marriages. The arrow is the stored direction. A uniqueness-backed index on Ana's identifier gives the query an efficient anchor. Ana's parent links lead to Cy. The marriage link has another type, so it is not followed. Cy's parent link leads to Eve. In this example the path through Cy reaches Eve. Unrelated families add no edges to this particular local traversal. Finding the correct starting node and restricting the traversal are separate jobs. Count the work done at each hop, not just the total number of people stored in the database. 00:00:56 When a short question becomes a wide walk Change the question to finding friends several hops away. Suppose each frontier has fifty fresh neighbors per node, with no overlap. That simplifying assumption makes the growth easy to see. Fifty links are followed. Each of the fifty has fifty: 2,500 more. 125,000 more. This is where a page load starts to hurt. The fourth frontier has six million two hundred fifty thousand paths under these illustrative assumptions. In real graphs people can overlap. Even so, unrestricted branching around a popular node can dominate the query. Apply the relevant relationship and time filters as early as the semantics allow. 00:01:41 Merge people before linking them A feed now asks us to add Ben and his relationship to Ana. Some nodes already exist. A pattern-level merge looks for the whole pattern, which can surprise a team expecting each component to be matched independently. Ana is stored. Ben is not. Without the appropriate identity constraint, a whole-pattern merge can create another Ana when the complete pattern is absent. Right way: the key matches the stored node. Once the endpoints are bound, merge the relationship between those specific nodes. A repeat of this example can find the existing link. Use stable identity properties and appropriate uniqueness constraints, especially with concurrent writers. Decide separately whether two relationships with the same endpoints have the same business identity. 00:02:31 Carry the newest family link into a read A volunteer saves a new family link and immediately inspects it from a different connection. The cluster can have committed the write while a chosen reader is still behind. The write is committed on the primaries. The secondary still has 41. The secondary answers from 41. The user does not see the new link. Forward the bookmark from the completed write. The reading server waits until it can serve a state at least that fresh. It has 42 and answers. A bookmark describes a causal lower bound for this session's read. It can make a reader wait, which is precisely the latency paid for keeping the volunteer's new link visible. 00:03:12 A celebrity changes the work One final question asks for connections through two acquaintances, Star and Pal. One name hides millions of edges. Looking only at the number of hops would badly underestimate the cost. From me to Star and Pal. Harmless. The next step follows every link of Star. Imagine two million of them. Starting from the other selective endpoint or filtering relationships earlier may reduce expansion while preserving the question. A degree cutoff deliberately changes which paths qualify. Choose the anchor and direction from the actual graph. If you exclude high-degree nodes as a shortcut, explicitly check which valid answers the new rule could omit.