Hi Riccardo,
I'm making a bit of an assumption about your insert. but I'm guesing we're
looking at something that can be 'unwound'.
Give you have a collection of 'items' to put into the database, I would
pass that to the DB in one query using UNWIND, so from Neo4jClient's point
of view that's going to be something like:
IEnumerable<Item> items;
client.Cypher.Unwind(items, "item")
.Create("(i:Item)").Set("i = item")
.ExecuteQueryWithoutResults();
Performance wise this will be a lot better, but it does depend on the rate
of 'items' you're getting - what sort of rate are you talking about?
Cheers
Chris
On Thursday, 27 July 2017 19:45:00 UTC+1, Riccardo Di Nuzzo wrote:
>
> Hi,
>
> I'm using the latest version of Neo4J 3.2 on Win10.
>
> I'm using the C# Neo4jClient library. I have a C# component that
> subscribe to a stream of messages. Every time a message is received it map
> to a node and write it down to Neo4J db. It works but it works very slow
> due to the fact that there are as many round trips with the database as per
> each received message. Imagine to receive hundred thousands of messages
> this component can take few hours to catch up with the writes.
>
> The question. I would like to commit to the db the writes every predefined
> number of seconds. During this period I can just create the nodes in memory
> and save them in one round trip with the db using a Bulk operation.
> Is this possible with Neo4J?
>
> I can see that there is something similar to be used when a csv is imported
> USING PERIODIC COMMIT
> but I can't find any documentation in order to use this or similar
> construct in code to achieve the result described above.
>
> Thanks
> Riccardo
>
--
You received this message because you are subscribed to the Google Groups
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.