A graph database stores data as nodes (entities) and edges (relationships), both of which can carry properties. It is designed to traverse connections quickly.
Why it matters
Questions like "friends of friends", shortest path, or fraud rings need many self-joins in a relational database, which gets slow as depth grows. Graph databases follow stored relationships directly, so traversal cost depends on the portion of the graph visited rather than total table size. Many systems also offer indexes on node and edge properties for fast starting points. Common uses are social networks, recommendation engines, and knowledge graphs.
Example
MATCH (a:Person {name: "Asha"})-[:FRIEND]->()-[:FRIEND]->(fof)
WHERE fof <> a
RETURN DISTINCT fof.name
This Cypher-style query returns friends of Asha's friends.
Common mistakes
- Using a graph database for simple tabular data where a relational one is cheaper and simpler.
- Ignoring supernodes, nodes with millions of edges that make traversals slow.
- Assuming all graph databases share one query language. Cypher, Gremlin, and SPARQL differ.
Related
Get notified when this term updates
Plus occasional practical tips on uptime and monitoring, nothing else. Unsubscribe anytime.
यह पेज सामान्य जानकारी है, जिसे हमारी संपादकीय टीम ने लिखा है और दस्तावेज़ीकरण बदलने पर अपडेट किया जाता है। सर्वर और प्रदाता अलग-अलग होते हैं, इसलिए बदलाव पहले सुरक्षित तरीके से जाँचें। देखें: संपादकीय नीति और अस्वीकरण.