IAmYourFaja IAmYourFaja - 1 month ago 17
Java Question

Neo4j and ORM (Hibernate)

I've been using RDBMSes since college and am really struggling with the underlying concepts of NoSQL databases...but I think their concept is really cool.

I believe I understand the following (please correct me if I'm wrong, because these play into my question here!):


  • NoSQL is not some formal specification; it is a concept underlying a new "breed" of databases that are not relational and do not use SQL

  • As such, each NoSQL system is different (for instance, MongoDB is JSON-centric)



If these are true, then let us redirect our attention to Neo4j, a "graph-based" database.

After perusing the site and the PDF, it seems like Neo4j is not only a database, but it also provides a Java API that essentially replaces the need for traditional ORM tools like Hibernate.

So, my final question is actually a request for clarification/confirmation of that last assertion, specifically:


  • Is it true that if my backend is entirely Neo4j-based, that I would have no need for Hibernate (which is my usual ORM)? Are these two APIs mutually-exclusive, or is there some way to benefit between using both of them?



Thanks in advance!

Answer

AFAIK, Hibernate is an object/relational mapping framework that only supports SQL-like databases. So you won't need / be able to use it if you use Neo4j, you would use Neo4j's API instead.

But nothing prevents you from using both Neo4j and an SQL database therefore mixing Hibernate and the neo4j API (most likely to store/query different objects within your project).

Have you checked the basic examples given on Neo4j website, such as http://docs.neo4j.org/chunked/snapshot/tutorials-java-embedded-hello-world.html ?

EDIT:

You are right, NoSql does not define a specific standard. You might want to have a look at this (short) introduction: http://martinfowler.com/articles/nosql-intro.pdf

Comments