Thanks for taking place in the ranch book giveaway.
I am experienced using traditional SQL databases, but I don't have a strong background in the related theory. My knowledge of graph theory is even weaker. I'm trying to understand how you would run analytical queries on Neo4j, and how well it would support them. To use the social network as an example, is it easy to say, "give me a list of all users and the number of friends they have, ordered by the number of friends, descending" (which of course is trivial to do with an SQL select)? Does it perform fairly well for that? If the Neo4j graph stores the date a relationship is established, could I write a query equivalent to, "How many people on the network added 30 friends in March 2014?" ?
That's my main question. As a minor question, I'm curious what the largest Neo4j data stores in production, that you're aware of, are.
Doing the same query in Cypher (Neo4j query language) would be equally simple:
MATCH (user:USER)-[rel:IS_FRIEND_OF]-x return user, count(rel) order by count(rel) DESC
One caveat is that query like this would scan entire graph (all users and all their IS_FRIEND_OF relationship), and would require to store the counts in memory for sorting.
For best performance, query should have as little start nodes as possible and touch as little properties as possible. However, this query would still perform reasonably well for a db of few million users for example.
Neo4j's sweet spot is the real time analytics for a few starting nodes (for example what does customer buys at the same time with products A and B).
As for the time based query, that is possible as well, but it would be up to application to store relevant timestamps as a relationship property. So the query would look like this:
AND count(rel) > 30
The Neo4j largest setup I have been involved with had ~1TB of data, was running on 3 nodes and had approx. 50 million nodes and few billion relationships.
Just realized I had a typo in the second query. It should be:
AND count(rel) > 30
A berm makes a great wind break. And we all like to break wind once in a while. Like this tiny ad: