Three shared links away
"Is this new account within three shared links of an account we closed for fraud?" A payments platform's risk team asks that of every merchant signup, because fraud rings pass the checks one account at a time and give themselves away through what they share: one account used the same phone as another, that one the same card as a third, and the third the same address as an account closed for chargebacks.
The data already sits in PostgreSQL, in a link table account_identifiers(account_id, kind, value) with one row for each phone, card or address an account has used. One link is a self-join on that table: the account's identifiers through an index on account_id, then the accounts sharing each one through an index on (kind, value). Each further link adds two more joins, and with the usual B-tree indexes each join, run as index lookups, costs one O(log N) probe against a billion-row table for every row it starts from (each account in the frontier, the accounts reached in the latest round, then each identifier those accounts have), plus reading every match it finds. The probes multiply as the frontier grows, the planner has to order five joins for three links from row estimates, and "up to three links" is a variable-length path, written as one query per length joined by UNION or as a recursive CTE: the planner can only guess how many rows each round produces, and a cycle brings back accounts already reached unless the query tracks where it has been. Indexing & query optimisation covers how a planner makes those choices.
Keep the edges with the node
A graph database stores the data the way the question reads: accounts, phones, cards and addresses are nodes, and each "account used this card" is an edge. With native graph storage, Neo4j being the best-known, each node keeps direct references to its own edges, so a hop costs work in proportion to the node's degree, its number of edges, with no index lookup. That is index-free adjacency. An index still finds the starting node; the hops after it skip one. Graph databases built on a key-value or wide-column store do a keyed lookup per hop instead.
So the check costs what the new account's neighbourhood holds, not what the graph holds: one phone, one card and one address typically reach a few dozen nodes within three links. On a social network, two hops out from one person touches her neighbourhood, thousands of nodes, and nothing else; go much deeper and the neighbourhood is most of the graph, which is why production traversals carry a hop limit.
The fraud graph adds a trap. A placeholder device ID that a broken SDK reports for every phone, or a parcel-locker address used by 40,000 merchants, is a node with an enormous degree, a supernode. One hop through it connects the new account to tens of thousands of strangers, and the query spends its budget there to answer "connected to fraud", which is true and worthless. So the check caps its results and, to bound its work, skips any identifier above a degree threshold: a value 40,000 accounts share is not evidence.
Is the shape of the connections the question?
Every schema has relationships, so ask what varies in the query. If it is the attributes, orders over £100 in March, you want tables and indexes. If it is the shape of the connections, paths of any length up to a bound, cycles, any route from A to B through fewer than N intermediaries, the graph model pays for itself. Its mainstream form is the property graph: nodes and edges both carry key/value properties, and a query language such as Cypher states the path directly. The fraud check, run for each phone, card and address in the signup, becomes MATCH (i:Identifier {kind: $kind, value: $value})-[:USED*..5]-(b:Account {status: 'closed_fraud'}) RETURN DISTINCT b LIMIT 20: up to five edges, because the first link is one, the identifier to an account that shares it, and each further link is two, account to card and card to account; the LIMIT is the result cap.
Inherited permissions and dependency analysis have the same shape, and so does "people who watched what you watched also watched", a three-hop candidate source (you, a title, its other viewers, their titles) in Recommendation systems: retrieval, ranking & cold start. "What is similar to this item?" by its content is not: it compares embeddings, not edges (Vector search: embeddings, nearest neighbours & hybrid search). And the fastest route across a road network is a graph question, but routing engines keep the road graph in memory in specialised, preprocessed structures rather than in a general graph database; Route planning on road graphs explains them.
The graph is a copy
The signup service does not write to the graph. The accounts stay in PostgreSQL, the system of record; a change stream carries each change out (Change data capture), a loader turns it into nodes and edges, and the risk scorer only reads the graph.
PostgreSQL owns the accounts; the graph is derived from its change stream. The scorer starts from the phone, card and address in the signup and asks for closed accounts within three links.
That makes the graph a secondary index over relationships: a design choice, not a weakness of graph databases, several of which are transactional. Every other reader already uses PostgreSQL or the stream, so the graph can stay shaped for one query pattern, and if it is lost or its model changes, you rebuild it from a snapshot of PostgreSQL plus the changes the stream has carried since. Making the graph the system of record for one query pattern gives that up.
The copy lags, usually by seconds, so when two ring accounts sign up a second apart, the second check may not yet see the first account's links, or the closed account they lead to. That is why the scorer starts from the phone, card and address in the signup request, not from the new account's node, which may not exist yet, and why a periodic re-scan of recent accounts catches the path the first check missed.
When a graph engine is too much
If your deepest query is one or two hops, a relational database with the right indexes, or a document per node, is the simpler answer; SQL vs NoSQL covers that choice. When the connections form a tree, one parent per node, Trees in SQL: adjacency lists, paths & closure tables covers storing it in relational tables. Graph engines also shard poorly: each hop that lands on another machine is a network round trip, and partitioning by a hash of the node ID puts most neighbours on other machines, so a three-link check becomes a chain of round trips. If you must shard, partition by community or geography and accept the imbalance (Sharding & partitioning). They aggregate poorly too: "chargebacks by month" is a warehouse question. And most teams have far more experience running PostgreSQL.
In between sits the adjacency list in a key-value store. The payment path asks one link on every card payment: has this device been used by a closed account? A set per identifier answers it, device:d81:accounts → {42, 77}, with the reverse in account:42:devices, in Redis or DynamoDB. One SMEMBERS per hop, one Redis SINTER against the set of closed accounts, and you own the fan-out. There is no planner and no variable-length path, but for one hop read thousands of times a second it is usually faster and cheaper than a graph engine.
Both directions of each link are Redis sets, written by one consumer from the link events. If Redis loses them, the consumer replays the events, so the topic must still hold every current link, for example compacted with one key per link.
device:d81:accounts and account:42:devices, so a crash between them leaves an asymmetric graph until the event is redelivered; the one consumer applying both from the link events acknowledges an event only after both writes and must be idempotent, as Idempotency & exactly-once illusions explains.Where to practise
Recommendation Engine lets you put Neo4j beside Kafka and a stream processor, which is this article's side index with "watched" edges in place of shared cards. The test of your design is the "also watched" traversal: give it a hop limit and a result cap, keep the graph off the write path of a play, and decide what it does at a title millions have watched, the supernode of that Grid. News Feed shows the other end: a follow graph asked one hop at a time lives in a table or a KV adjacency set, as Worked design: a news feed shows.