When fraud queries pile JOIN on JOIN, the data is a network
AWS itself says purpose-built graph databases add most value for highly connected data; the clue is in how the client phrases its questions.
In brief
- A graph database earns its place when questions follow relationships over several hops; simple tabular data is still better served by a relational database.
- Neo4j centers on Cypher; Neptune supports Gremlin, openCypher and SPARQL, with one writer and up to 15 read replicas.
- GraphRAG targets questions that span an entire document collection, where conventional RAG falls short.
Three tables and one question are enough to strain a SQL query. Take a hypothetical fintech where you are in your second week. The risk team hands you accounts, payment cards and login IP addresses, then asks something that sounds simple: “Which accounts share a card, email or IP with an account confirmed as fraudulent, including indirectly, two or three layers out?”
You open Postgres and write the first query. The second is twice as long. By the third layer, the query is a long run of JOINs, it is slow, and nobody in the room is sure it is right.
An FDE needs to recognize this moment early: the client’s data is a network that happens to be stored in tables. Spot it in time and you choose the right tool in week one, instead of rewriting the whole pipeline in month two.
When is data really a network?
AWS defines a graph database as one that stores data as a network of entities and the relationships between them. In the same document, it says purpose-built graph databases add the most value for highly connected datasets, while simple tabular data is better suited to a relational database.
The second point matters as much as the first. Order lists, payroll and standalone transaction logs can stay in Postgres. The real signal is in the client’s questions, when they follow a chain of “who connects to whom, through what, in how many hops”.
The use cases AWS lists all share that shape: social networks, product recommendations, fraud detection through shared emails, cards and IPs, route optimization, and knowledge management. When a client describes a problem, listen for a path that runs through several entities.
One fraud ring, written two ways
Start with a relational schema: an accounts table, plus the join tables account_cards(account_id, card_id) and account_ips(account_id, ip). Finding accounts that directly share a card with a flagged account, for just one type of attribute, already takes this:
SELECT DISTINCT ac2.account_id
FROM accounts f
JOIN account_cards ac1 ON ac1.account_id = f.id
JOIN account_cards ac2 ON ac2.card_id = ac1.card_id
WHERE f.flagged = true AND ac2.account_id <> f.id;
To add IPs, you UNION another similar block. To go one layer further (A shares a card with B, B shares an IP with C), the JOINs multiply with every combination of attribute types. Each new layer means another rewrite.
In a graph model, accounts, cards, emails and IPs are all nodes, and a USES relationship links each account to the things it uses. The same question as a Cypher query on Neo4j:
MATCH (f:Account {flagged: true})-[:USES*2..6]-(a:Account)
WHERE a <> f
RETURN DISTINCT a.id
Each “shared” step is two edges (account to card, card back to another account), so *2..6 means going at most three layers out. Changing the depth means changing one number. A new attribute type, such as phone numbers, needs no change to the query either: just add nodes and USES edges.
That is the advantage to show the risk team firsthand. AWS also promotes performance that stays consistent as graph data grows; treat that as a vendor claim and measure it on the client’s data before promising anything.
Neo4j or Neptune: ask about language and infrastructure first
Graph query languages remain fragmented: Cypher from Neo4j, Gremlin from Apache TinkerPop, SPARQL from the W3C for RDF, and GQL, the ISO standard. There are two main schools of data model: the labeled property graph (nodes and edges carry properties, as in the example above) and RDF.
| Aspect | Neo4j | Amazon Neptune |
|---|---|---|
| Data model | Property graph | Both property graph and RDF |
| Language | Cypher; from version 2025.06, new features go only into Cypher 25, and Cypher 5 is frozen | Gremlin, openCypher, SPARQL |
| GraphRAG | Positions itself as a “knowledge layer” for AI, promotes Agentic GraphRAG | Managed GraphRAG through Amazon Bedrock Knowledge Bases |
A Neptune cluster has one primary writer instance and up to 15 read replicas, all sharing a cluster volume that spans multiple AZs. Alongside it sits Neptune Analytics, a separate in-memory analytics engine that complements the Neptune database when large volumes of graph data need analysis.
On site, that table comes down to a few everyday questions. If the client already runs everything on AWS and its operations team does not want another system, Neptune reduces friction. If the client’s data is already RDF or an industry ontology, Neptune with SPARQL is the natural choice.
If the client’s team will write and maintain queries over the long term, Cypher tends to be readable for people used to SQL. Because Neptune supports openCypher, you can prototype in Cypher, then check each feature before settling on a platform. State the Cypher version clearly in the handover document, because Cypher 5 no longer receives new features.
What kind of question does GraphRAG answer?
Graphs have a second use: as a foundation for AI question-answering systems. Microsoft’s GraphRAG research argues that conventional RAG fails on global questions directed at an entire text corpus. That is the motivation for a graph-based approach.
Say the client has several thousand incident reports. “What fault caused the incident on the 12th?” is a local question: a vector search that finds the right few passages is enough.
“Which cause has recurred most often over the past three years?” is different. No passage contains a ready-made answer, and retrieving the top-k most similar passages gives only a skewed view.
A graph helps here because it gathers entities (equipment, suppliers, fault types) and their relationships across the whole collection, so the system can answer from structure instead of a few disconnected passages. But if 90% of the client’s questions are local, GraphRAG only adds cost and complexity.
Working step by step at the client site
Start with questions, then tools. Collect 15 to 20 real questions the client needs answered, and mark which ones cross several relationship hops and which span the whole document collection.
Next, draw the node and edge model on a whiteboard with the client’s domain experts. For the fintech example, four node types and one edge type are enough for a demo. Then load a slice of real data, rewrite the two or three hardest questions in Cypher or Gremlin, and put them beside the SQL versions so the client can compare.
Only then choose a platform, based on the infrastructure the client has, the language its team will maintain, and whether heavy analytics need to move to an in-memory engine such as Neptune Analytics.
Common mistakes
The most common mistake is using a graph database for data that is naturally tabular, just because “GraphRAG is hot”. The second is modeling everything as a node, including attributes that should simply be properties, which bloats the graph and slows queries.
The third is running variable-length queries with no upper bound, such as [:USES*], on production data; in a dense network, one can traverse almost the entire graph. The fourth is trusting marketing numbers, such as the 100k+ queries per second Neptune advertises, instead of benchmarking on the client’s own workload.
For developers moving into FDE work, this skill is easy to demonstrate. A small repo with the same question written in SQL and Cypher, plus a note on why you chose that model, says more than a “knows Neo4j” line on a résumé.
When a job description covers a familiar graph use case such as fraud detection, recommendations or knowledge management, put that repo at the top of your application.
The next time a SQL query starts joining a table to itself, stop and ask the client how many relationship hops the real question crosses.
Was this article useful?
Thanks for the feedback!