Im currently using Neo4j 2.0+ and cypher to create and save sessions.
My project at times requires multiple writes per second to a node labeled 'ChildSession', and I notice that when I 'increment' the ChildSession_ID in cypher, I often have ChildSession_ID's skipping numbers or being the same number.
Not sure if neo4j/cypher is too slow for my requirements, but I doubt it since the internal Neo4j Node ID's are incremented normally.
The cypher command i'm using, to increment ChildSession is:
match (p:ChildSession) with count(p) as Total
Create (b:ChildSession{ChildSession_ID:Total + 1 })
One would expect the ChildSession_ID to increment, but I get the following results, when I check the nodes in neo4j browser:
match (u:ChildSession) return u,ID(u)
Results:
ChildSession_ID 1
44997
ChildSession_ID 1
44998
ChildSession_ID 1
44999
ChildSession_ID 4
45000
ChildSession_ID 5
45001
ChildSession_ID 6
45002
ChildSession_ID 6
45003
ChildSession_ID 8
45004
ChildSession_ID 8
45005
I've been unable to get neo4j to increment accurately. I tried using redis and its hincrby command which increments and then put this variable into my cypher query's ChildSession_ID attribute. This method works, but I would rather do it with cypher instead.
The argument could be made to use redis only instead for fast writes, but I use a hiearchy of session levels and need the querying neo4j offers.
Thanks.