The road so far….

August 9, 2010

Exploring Neo4J, the nosql graph database

Filed under: java — Tags: — Rahul Sharma @ 8:15 am

After hearing much about Neo4J, the graph database, I started my quest of exploring it. My goals were simple, evaluate it and possibly refactor and use it at one of our graph solutions. Now  after the evaluation I have found out that it is quite  simple and efficient  to use, but there are certain things esp  a shift in design that it asks us to do  in order to use it properly. Also the complete Neo4J library is divided into components and the kernel lib is quite light weight (a few Kbs) and can easily be shipped with the application.

Let us say  we want to implement a use-case where there are persons and a person can be connected to other persons. In order to use Neo4J  we must think about  POJOs in terms of  interfaces and corresponding implementions. This is so because the database is a key-value store at the back, so it asks us to store the properties of the POJO in terms of  key-value pairs. Moreover there are no foreign keys in Neo4J, objects in the db are connected with other objects using Relationships. So the connections between different persons  will be represented by a  custom connection enum which will  implement the RelationshipType interface. (more…)

Advertisements