A fraud team needs to find rings of accounts connected through shared phones, addresses and devices, following links several hops deep. Which data structure and AWS service fit best?
- Exam domain
- Data Ingestion and Transformation34% of the exam
- Difficulty
- Medium
- In this mock
- 33 questions on this domainPractise this domain
Why the exam asks this
Task Statement 1.4: Apply programming concepts.
Objective in the exam guide: Describe data structures and algorithms (for example, graph data structures and tree data structures).
Choosing the data structure that matches the question avoids slow, complex workarounds. Relationship-heavy problems are the classic graph case.
Why D is the answer
A graph, stored in Amazon Neptune
Graphs model entities and their relationships directly, and graph databases traverse many hops efficiently.
Remember: Relationships several hops deep: a graph structure, in a graph database.
How it works
A graph stores nodes, such as accounts and phones, and edges, the relationships between them.
Following relationships several hops deep is natural in a graph, while tables need many joins.
Amazon Neptune is a managed graph database on AWS.
Clues in the question
The words that point to the answer, and what each one tells you.
- Connected through shared phones and addresses
- Relationships between entities.
- Several hops deep
- Graph traversal.
In detail
- Graphs are made of nodes and edges; trees are a special case with no cycles.
- Multi-hop relationship queries are slow in tables but natural in graphs.
Side by side with look-alikes
| Structure | Multi-hop relationships |
|---|---|
| Graph (Neptune) | Natural and fast |
| Relational with joins | Possible but slow |
| Key-value | Not supported |
| Flat file | Not supported |
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. A flat CSV file in S3Wrong
A flat file has no relationships to traverse.
B. A key-value table with no relationshipsWrong
Key-value lookups do not follow links.
C. A single relational table with no joinsWrongMost tempting
Without joins, relationships cannot be followed.
Why it tempts: Relational databases are the default store. But without joins, the relationships cannot be followed at all.
D. A graph, stored in Amazon NeptuneRight
Relationships several hops deep: a graph structure, in a graph database.
In practice
- Model the entities and relationships first, then choose the graph query language.
Use case
An illustrative scenario, not a real incident.
A fraud team queries Neptune for accounts within three hops of a known fraudster and finds a ring of 40 accounts.
See how it works
flowchart LR A1["Account A"] --- P["Phone 555-0101"] A2["Account B"] --- P A2 --- AD["Address 12 Main St"] A3["Account C"] --- AD A3 --- D["Device X"] A4["Account D"] --- D
How to read this chart
- "Account A" leads to "Phone 555-0101".
- "Account B" leads to "Phone 555-0101" and "Address 12 Main St".
- "Account C" leads to "Address 12 Main St" and "Device X".
- "Account D" leads to "Device X".