Easy Graph Database Instancing with Neo4Ji

When I started running into use cases for graph databases a little while ago, Neo4J quickly caught my attention. Cypher, the query language, is designed to be intuitive and readable, and the visual query interface is really fantastic. It was one of those technologies that seemed like it was designed by people who shared my values.

Why Neo4Ji?

As much as I loved Neo4J, there was a key limitation that made it difficult to integrate it into my workflow: Neo4J is very much designed to run as a single monolithic database on a given machine. There is no support out of the box for multiple databases on a single Neo4J server instance. In fact the only way to get multiple databases on a single machine is to run multiple Neo4J processes, which requires a separate instal and configuration file per instance.

This was very much an obstacle for me. In terms of software development, I'm very much a fan of rapid iterative development. I like to be able to spin up multiple versions of an application side by side to compare. Sometimes it's useful to create a database instance and seed it with a particular data set for a single test. With Neo4J this kind of nimble development was not easy: instancing either meant undergoing the cumbersome process of manually installing Neo4J at multiple locations, or resorting to a hack like namespacing all the nodes for a given application instance.

The Solution

Like any good software engineer, where no good solution existed, I created my own. In an afternoon, I put together a NodeJS command line utility which automates the process of instancing Neo4J databases.

Neo4Ji adheres to the Unix philosophy: it does one thing well as simply as possible. The CLI allows for a Neo4J instance to be created, launched, stopped, or deleted with a single command. With Neo4Ji, it's possible to have a running instance of a Neo4J database with only the following two unix commands:

$ npm install neo4ji
$ neo4ji start myDatabase

I published to github and NPM, and accepted a small number of pull requests to improve support for a wider selection of linux distros, and to keep up to date with the evolving NodeJS API.

Hire me! I'm a freelancer and I'm always looking for projects. I can make you a really great mobile app or back-end. find out more at work.spencerkohan.com or email me at [email protected]