As I said in MongoDB MapReduce tutorial, the best way to validate that you’ve got the basics right about a system is to use some basic code. And this is exactly the idea behind this post: to take a look at a very (very) basic tagging app in InfoGrid and Neo4j.
The code with more details can be found ☞ here.
The Neo4j code was contributed by Mattias Persson from Neo Technology (thanks Mattias).
Note: I couldn’t figure out a way to make the code more readable that this. But you can hover over the code snippets and you’ll get the option to see the original source code.
Here are my notes about the two code snippets above:
- everything in Neo4j must happen inside a transaction even if it’s a graph traversal operation (this gives a very strong Isolation level). The InfoGrid traversal code seem to happen outside the transaction, so it sounds like it supports a more relaxed isolation level (interesting question here is: if traversal would happen inside a transaction, would that isolate it from seeing possible external modifications?)
- InfoGrid’s central element is
MeshObject, while Neo4j has
Relationship. Generally speaking I have found the terminology in InfoGrid a bit more unusual (f.e.
- the Neo4j uses also the
LuceneIndexServicefor indexing both the tag and web resources nodes, but that’s only becaus e the code there makes sure not to duplicate either tags or web resources (i.e. this functionality is not present in the InfoGrid code and I don’t know how that would look like)
- in both cases a relationship gives you access at both its ends. While both InfoGrid and Neo4j documentation speak about bidirectional arcs
Update: The guys from Sones picked up my challenge and they show up their C# implementation on this ☞ post. I have included below the code for reference
Update: I’ve just got another submission from Filament. Code is included below and their original post is ☞ here