You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey there,
I have been looking into the logic to save graphs with the Neo4jTemplate. It seems like the processing is very slow if you don't have flat Nodes to save. Let's say we have something like this modelled:
Person -[:lives_at]-> Adress
If we save Persons with Adresses now, the expected operations would be (simplyfied):
bulk save all Persons
bulk save all related Adresses
bulk save Relationships between Persons and Adresses as given
(maybe even save all nodes in chunked bulkrequests and all relationships in other)
But thats not what happens (even in simple scenarios: no version property, no dynamic label, modelled own IDs):
bulk save all Persons
save each Adress on its own
save each Relationship on its own
This leads to very expensive save operations, if you save a graph with more than 2 node types involved.
I think the hole save operation should be overhauled:
pre processing to collect and prepare all nodes and relationship to save
and after knowing what to save the operation itself can happen in bulk(s)
If this is fine with you, I would start with this in some time.
Best regards
The text was updated successfully, but these errors were encountered:
Hey there,
I have been looking into the logic to save graphs with the Neo4jTemplate. It seems like the processing is very slow if you don't have flat Nodes to save. Let's say we have something like this modelled:
Person -[:lives_at]-> Adress
If we save Persons with Adresses now, the expected operations would be (simplyfied):
bulk save all Persons
bulk save all related Adresses
bulk save Relationships between Persons and Adresses as given
(maybe even save all nodes in chunked bulkrequests and all relationships in other)
But thats not what happens (even in simple scenarios: no version property, no dynamic label, modelled own IDs):
bulk save all Persons
save each Adress on its own
save each Relationship on its own
This leads to very expensive save operations, if you save a graph with more than 2 node types involved.
I think the hole save operation should be overhauled:
pre processing to collect and prepare all nodes and relationship to save
and after knowing what to save the operation itself can happen in bulk(s)
If this is fine with you, I would start with this in some time.
Best regards
The text was updated successfully, but these errors were encountered: