Skip to content

Using projections for persisting data #2390

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

Closed
gonzalad opened this issue Sep 30, 2021 · 2 comments
Closed

Using projections for persisting data #2390

gonzalad opened this issue Sep 30, 2021 · 2 comments
Assignees
Labels
status: waiting-for-feedback We need additional information before we can continue

Comments

@gonzalad
Copy link

This issue is related to a the following comment where we mention using projections for persisting data.

Is this feature already planned ? And if yes, in what milestone ?

#2305 (comment)

small preview of the future: There will probably nested projections coming up.
So you can describe your graph model "completely" in SDN but for load and persist operations
use projections as a kind of blueprint for the data that you really want to fetch or persist.

This will improve not only the performance of fetching data (by just not fetching unneeded data)
but also the way data gets persisted without touching / updating unchanged parts.

I have this question because I'm migrating an application from SDN5 to SDN6.

The application has a deeply nested structure (tree-like entities)
In SDN5 I could persist the entities without having to load all the entity graph.
In SDN6, this is not possible anymore (so even changing a simple attribute in a node would require me to load all the graph).

So the idea for me would be to:

  • keep my current tree-like entities (to use when I need to manipulate the whole tree).
  • have projections for node manipulations, and use those projection for queries but also for persistance operations

Thanks !

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Sep 30, 2021
@meistermeier
Copy link
Collaborator

Yes, this is already available since 6.1.3 (https://github.com/spring-projects/spring-data-neo4j/releases/tag/6.1.3)
Some documentation on the topic:
https://docs.spring.io/spring-data/neo4j/docs/current/reference/html/#projections.sdn.multi-level
https://docs.spring.io/spring-data/neo4j/docs/current/reference/html/#projections.sdn.persistence

If this solves your issue, please close it. If you have any further questions, you can reach out on StackOverflow or our Discourse https://community.neo4j.com/c/drivers-stacks/spring-data-neo4j-ogm/30

@meistermeier meistermeier added status: waiting-for-feedback We need additional information before we can continue and removed status: waiting-for-triage An issue we've not yet triaged labels Sep 30, 2021
@meistermeier meistermeier self-assigned this Sep 30, 2021
@gonzalad
Copy link
Author

Thanks very much @meistermeier, I don't know how I managed to miss it in the docs !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-feedback We need additional information before we can continue
Projects
None yet
Development

No branches or pull requests

3 participants