-
Notifications
You must be signed in to change notification settings - Fork 617
Saving large graphs with Spring Neo4j #2587
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
What do you want to update? If something "near" the root entity, projections might help to make SDN just ignore the deeper related notes. Also they are a good fit if you want to go deep into a specific branch of the graph without looking left or right. Different projections can be used for different use-cases. |
I want to save a graph which has many levels and many children at each level, just like the one in the image included in the OP. Client A - aggregated root
It is very slow when I try to save the object like this: clientRepository.save(clientA) |
There is a 6.3.3-SNAPSHOT available that should improve relationship performance. Maybe you could give it a try. I am happy to hear your feedback. Related issue: #2593 |
Hi Gerrit thanks for your help! Any chance we getting this in 6.1.x? Because of compatibility issues we can't upgrade to SDN 6.3.x yet |
Unfortunately this version won't get any updates Pascal Release train mentions OSS Support until: May 2022 |
There is now a |
Hi Gerrit, awesome news, thank you! Regarding the compatibility issues I don't remember exactly why we are tied to 6.1.x , I guess it was related to the fact that our IT test were failing due to #2488 maybe? I just tried to run our tests with SDN 6.3.2 and I'm getting
|
That's just the fact that you already defined a database selection "somewhere" in your config and maybe in you tests you are using the |
Well, in regard to this issue I will try to take a look tomorrow. What you're saying about me having I see that release 6.3.2 includes the fix for the issue I mentioned earlier but neo4jClient.getDatabaseSelectionProvider() is still returning null when I run my (integration) tests EDIT: Maybe I should add that our failing IT tests set up an embedded server, which may cause the selection provider to return null. I've just tried to specify a spring.data.neo4j.database = "neo4j" but when the Neo4jTemplate bean is instantiated, it checks the neo4jClient.getDatabaseSelectionProvider() which is null |
Okay, so as we are tied to Spring Boot 2.4.x because our dependency with Spring Cloud 2020 we can't upgrade to SDN 6.2.1+ (https://docs.spring.io/spring-data/neo4j/docs/6.2.0/reference/html/#dependencies.spring-framework) or 6.3.0+ (https://docs.spring.io/spring-data/neo4j/docs/6.3.0/reference/html/#dependencies.spring-framework) because both needs a newer Spring Core version, currently Spring Boot 2.4.13 pulls Spring Framework 5.3.13 Also, the neo4j-java-driver dependency was being pulled by the APOC plugin dependency which was the reason I was getting the Exception I mentioned previously. I had to exclude it in my pom.xml to avoid getting that Exception while running our Integration Tests. |
@mrksph I have been saving large graphs similar to your example with neo4j ogm. Depending on the complexity of the graph I’ve seen it perform anywhere from 4-10 faster than sdn. Here’s a link to an issue I have open with linked projects showing the performance difference. May be worth giving the ogm a shot if sdn is still too slow. |
Hi all,
I'm encountering some problems while trying to save a relatively big graph using Spring Data Neo4j .save() method passing the aggregate root. In the following image, you can see an example (the graph in the image is not complete, it's a little larger than that)
Is there any other way to speed up the save?
I tried to save first the nodes at depth 1 or depth 2 using concurrency but I think it won't work.
Thanks
The text was updated successfully, but these errors were encountered: