Graph databases in Orchard
On the second day of Orchard Harvest one of the hackathon groups explored the idea of using graph databases, specifically Neo4j, in Orchard. I followed up on the topic and researched on how graph databases can play along in an Orchard module.
I've searched for .NET graph databases but couldn't really find any up-to-date project, even .NET drivers for graph databases are scarce. Neo4j seemed indeed like the best way to explore further: it's a very popular graph database and exposes a RESTful API so other pieces of software can use it even if they don't run on Java like Neo4j itself. Fortunately Tatham Oddie and his team developed Neo4jClient, a .NET wrapper that provides a nice interface to interact with Neo4j through its web services.
It turns out that using Neo4jClient from Orchard is quite simple, I've developed a Neo4j driver for Associativy. One special information worth noting that there should live only one connection to a Neo4j server, as advised in the wiki. This required the usage of an ISingletonDependency, but nothing really complicated. Feel free to look at the source code of the Associativy Neo4j driver.
Graphs are wonderful things and there are occasions when your data is best modelled by a graph. Don't be hesitant to dive into the world of graph databases: at least Neo4j is usable with Orchard.
Happy depth-first searching!