Thursday, May 23, 2013

Optimistic Locking in Neo4j

Optimistic locking is a technique commonly employed with relational databases to control concurrent access to data. It is common for user interactions to span over multiple system transactions (web and database) and rather than locking the data, which might impact performance, optimistic locking allows to detect write conflicts to ensure that the system stays consistent. For this to be efficient, the possibility of conflicts over the same data should be fairly low.

Thursday, May 2, 2013

Labels and Schema Indexes in Neo4j

Neo4j recently introduced the concept of labels and their sidekick, schema indexes. Labels are a way of attaching one or more simple types to nodes (and relationships), while schema indexes allow to automatically index labelled nodes by one or more of their properties. Those indexes are then implicitly used by Cypher as secondary indexes and to infer the starting point(s) of a query.

I would like to shed some light in this blog post on how these new constructs work together. Some details will be inevitably specific to the current version of Neo4j and might change in the future but I still think it’s an interesting exercise.