Spring data neo4j/OGM

Between SDN/OGM which one should be used where and why ?

A little explanation:
Neo4j-OGM (object graph mapper) is the foundation layer for all query generation and mapping purposes and can be used as a stand-alone library in pure (non-Spring) Java environments. It runs with Neo4j 4.0 via Bolt or HTTP but does not support the newest features like multi-database or reactive programming model.
Spring Data Neo4j makes use of OGM and enables you to use the more convenient way of accessing your data in a DomainDrivenDesign way through repositories. Additionally it brings e.g. the support for Spring Transactions and similar. Its feature set is limited to the capabilities of the underlying Neo4j-OGM.

If your are working in a Spring (Boot) environment there is now a new library out called Spring Data Neo4j RX. This is a data access layer completely re-written with support for the reactive programming model (but also imperative of course) that also contains a lot improvements over SDN/OGM from what we have learned before.
You can see it on the same abstraction level as the original SDN but it only depends on the Neo4j Java driver. All mapping is based on the foundation of the Spring Data Commons library.

There is already a plan for later this year to bring in SDN-RX as the replacement of Spring Data Neo4j into the official Spring Data release train.

1 Like