2012/10/05

the matrix revisited - neo4j

A long time ago in a galaxy far far away ... hold on, that's the cue-line from a different movie. Anyway, some time ago I was an IDMS database administrator. For those who don't know it, search for CODASYL in wikipedia. Those who do know will agree that it was superior to a relational database (and older), but it required specific knowledge of the problem you wanted to solve and often the database would then perform badly for a different problem.

Relational databases - once machines were fast enough to alleviate the speed difference - were (and still are) easier to work with. You don't need a specialist team of database administrators/architects.


But relational databases were apparantly not safe against all competition (enter tune of The Empire strikes back here). At the moment there's once more a war going on between SQL and NOSQL. By the way, did you know that NOSQL stands for Not Only SQL ? I think that's important, because it means that side of the war at least knows that both sides are there to stay.


In my book I had an example using MongoDB. So when I was recently asked to use something else than a relational database in a project ... the choice was clear, was it not ? Of course it was. I went out, searched the web and came up with graph databases of which Neo4j is the top dog.


And since my own knowledge about NetKernel is more advanced than at the time of writing the MongoDB chapter, I set out to write a complete Neo4j integration.


You can find the main module here : https://dl.dropbox.com/u/65770556/urn.org.netkernel.neo4j.embedded-1.7.2.zip (note : you have to put the neo4j 1.7.2 libs in the lib subdirectory)

You can find the unittest module here : https://dl.dropbox.com/u/65770556/urn.test.org.netkernel.neo4j.embedded-1.7.2.zip

I was extremely pleased when I saw what Neo4j could do. This is the way Computer Associates should have taken IDMS, rather than pay lip service to relation databases and produce a flesh nor fowl hybrid that nobody wants. For yes, a Graph database is very much like a CODASYL database (given 20+ years of fast evolving). My old skills are back in demand !


The issue IDMS had remains in Neo4j though (in my opinion). It is a specialist database. You will need good database administrators/architects (preferably the same team) to make it work for your problems.

Right, that's it for this week.

Disclaimer :
  • I'm voicing my own personal opinion on Neo4j based on working with it in a limited environment for three weeks. 
  • The code I deliver is not production ready. It allows you to play with Neo4j in NetKernel and enters a couple of constraints to make things easier which are not part of Neo4j as such. The code is delivered "as is" and is not guaranteed to do anything. It contains no documentation yet (that'll change in a couple of days), check the unittests for use examples.