hi all
I wanted some advice on a system we're developing, using Neo4j. We are
developing in C#.net, and making good use so far of Neo4jClient
(
http://hg.readify.net/neo4jclient/wiki/Home) - so we're basically
using the REST Api.
Our system, in a nutshell, has a particular components that I need
advice on:
The system will periodically read information from the graph, do a
complex set of calculations within our code (i.e. external to the
graph), and then persist the result sets back to the graph.
Reading the data out of the graph looks like it will be quite quick
(thanks to some nifty Gremlin, a little chunking of the results, and
some parallelisation), but it is the writing it back that concerns me
- the data would likely have doubled or tripled in size (i.e. if we
read 20000 nodes, we might commonly write back about 45000...)
Because we are working in .Net, we are fairly limited in the
approaches we can take - as in, as far as I can see, we can only do
things over the REST Api.
Up till now, I've been running simple hacky tests to try out the
batching api over REST, with reasonable success.
However, I came across a problem while trying to parallelise my
batches, which I'm pretty sure was because of deadlocks (struggling to
get my logs working - but thats a topic for another day). Firstly, is
this a normal problem, or am I not reading the signs correctly? (For
info, the nodes I insert would probably each have 4 or 5 edges, and at
least 2 or 3 of those edges are to nodes which in turn will have a LOT
of edges... which means the graph is quite dense. In other words, the
likelihood of creating 2 edges on different threads, simultaneously,
where those edges both connect to the same node, is pretty high)
I ended up writing some truly horrible code to batch sets of data that
are completely disconnected, to prevent deadlocks from occurring when
running in parallel, which worked quite well (although my algorithm
itself now takes time to run locally)
I guess this is a fairly broad, open-ended question right now: does
anything I've said jump out as "wrong! wrong! wrong!"? Am I missing
something about batching over REST, and deadlocks, and
parallelisation? Have I completely missed an option available to me?
Any other .net guys out there who have ideas, specifically in the area
of how to get a pretty heavy, transactional system to perform
well...over REST?