3 ms·
You can represent a graph in just about any data structure. The key thing that separates a graph database like Neo4j (http://neo4j.org http://neo4j.org) from a
by espeed 15y ago
You can represent a graph in just about any data structure.
The key thing that separates a graph database like Neo4j (http://neo4j.org http://neo4j.org) from a graph represented in a relational database is that in a real graph database, relationships between nodes are explicitly connected so you don't have any overhead from external index look ups during traversals.
Index look ups also degrade the bigger the index gets in a relational database, whereas in a directly connected graph, it doesn't matter how many other nodes or relationships there are in the graph, performance stays constant -- Neo4j for example does about 2 million traversal steps per second (a traversal step resembles a join in a RDBMS).
- 3pt14159 15y ago2 million a second? That must be with cached data, no way it's picking up from disk that fast, even in the case where it has all the data lined up. Edit: I'm not saying you are wrong, I'm curious to see if they can do it and what I can learn from it.
- espeed 15y agoYes, Neo4j has a caching algorithm that optimizes traversals. See http://docs.neo4j.org/chunked/stable/configuration-caches.html#_object_cache http://docs.neo4j.org/chunked/stable/configuration-caches.ht..., http://docs.neo4j.org/chunked/stable/performance-guide.html http://docs.neo4j.org/chunked/stable/performance-guide.html