chris webster wrote:Any of you JavaRanchers got any experience using Neo4j?
I used it in one component in one of my customer projects.
Reason for using it was not performance - atleast not intentionally - but to simply reduce the
volume of code that would otherwise have to written and tested if using plain RDBMS SQL queries.
The component modelling involved users and groups. A user could become members of multiple groups.
Each group could have multiple child groups, and each child group could have its own child groups, and so on.
Users could could become members at multiple levels in the group hierarchy.
Membership in a subgroup implied membership in the parent group.
Certain use cases involved providing some shared resources at every group level to all users who were members in that group.
Implementing such membership querying using SQL in mysql looked like a pain. Mysql did not (probably still does not)
have recursive queries, and even if it did, it probably would have to be coded as SQL procedures.
Even worse, I was using hibernate for DB operations - a framework which I'm not exactly a fan of.
Performance optimization hacks post
testing seemed inevitable with this approach.
Neo4j seemed like the right tool for the job, because the above model is a graph (each group and user is a node, and presence of an edge is membership).
Wrote some prototypes and realized the API was exceedingly simple to use. Documentation (API and user manuals) were good.
The source code was also rather educative on graph algorithms, none of which I was familiar with at the time.
Response times of membership queries even with deep nesting levels was excellent.
All in all, that component, which had all the makings of a month long pain in the neck, became a breeze to implement within a couple of days, thanks to neo4j.
However, I didn't get any experience about its scalability, replication or high availability aspects; the project didn't require them.
I'm glad I used it. If I run into the same kind of situation in future involving groups, users, and recursive memberships
(RBAC authorization strategy is one common enterprise use case I can think of), neo4j is something I'll definitely look at.