Graph Databases @ DC .Net

I was at the DC .Net User Group recently and heard a talk by David Makogon on Graph databases, specifically neo4j. I had been interested in graph databases for a while but never had both the time to dig into them and a problem that seemed suited to their use.

For those unfamiliar with graph databases, they are a set of nodes and relationships between pairs of them. This allows certain classes of queries that are difficult to write against a SQL or document database to be written almost trivially. The default package has instructions to set up some demo databases, including a movie database. You could query the demo movie database with:

MATCH (martin:Actor { name:"Martin Sheen" }),(michael:Actor { name:"Michael Douglas" }),
p = shortestpath((martin)-[*..15]-(michael))
return p;

That would find the shortest path through a database of movie data between Martin Sheen and Michael Douglas in the 6 Degrees of Kevin Bacon sense. It is that easy in Cypher, neo4j’s query language.

Learning things like this are why I love participating in local user groups for technologies and topics that I’m interested in. I use Meetup to find my groups, but there are other options. Find some local user groups for things you are working with or interested in and go hear a talk. You don’t need to be a regular, just go see what’s going on, nobody will bite.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s