difference between storing data into neo4j graph database using Java and Spring?

185 Views Asked by At

I'm little confuse that if my project is on Spring and I want to use neo4j with java not with Spring Data .

what is a good practice ?

Thanks

3

There are 3 best solutions below

0
On

If you're using spring, best practice would probably be to use spring-data-neo4j, because its integration with the rest of spring is quite nice. That being said, of course you don't have to. You have the options listed by others, and of course you can use the native Java API.

If you've already taken the step to use spring, in general I'd recommend using spring-data-neo4j unless you have a compelling specific requirement not to.

0
On

OGM for Neo4j is now separated from Spring : https://github.com/neo4j/neo4j-ogm. So you don't have to use Spring Data and can still use OGM (or even stick with Core Java API if you want). But Spring Data has some nice features (i.e. repositories) so if I were you I would give it a try.

0
On

You have another options for your Java app. I assume you are talking about client application, not about extension for Neo4j.

One option is to use REST API from your application. As a client you can use Jersey client and another REST client, which you like.

Another option is to use OGM, which is Object Graph Mapping Library, like Hibernate for rdbms. https://github.com/neo4j/neo4j-ogm