Skip to content
Andreas Ronge edited this page Aug 6, 2014 · 1 revision

Neo4j.rb (neo4j gem) is a JRuby wrapper for the Neo4j graph database.

The neo4j gem makes it possible to use neo4j from Rails. The neo4j gem has dependencies to three other neo4j gems: neo4j-core, neo4j-wrapper and neo4j-cypher

It (from version 2.2.3) uses Neo4j version 1.8.1.
To use Neo4j 1.9.M03 (the JAR gems: neo4j-community, neo4j-advanced and neo4j-enterprise) specify it in your Gemfile

Content

  • neo4j – Using neo4j together with Rails
  • neo4j-wrapper – Mapping ruby classes to neo4j (without rails)
  • neo4j-core – Working with the Neo4j Java API but in a nicer Ruby API.
  • neo4j-cypher – Querying the database use a Ruby DSL

Why ?

  • Whiteboard friendly – you use the language of graph (node, properties and relationship) to describe your domain as you already do on the whiteboard.
  • Seamless integration with Ruby on Rails:
    • Example: rails new myapp -m http://andreasronge.github.com/neo4j/rails.rb -O
  • Schema Less and Efficient storage of Semi Structured Information
  • No O/R mismatch – very natural to map a graph to an Object Oriented language like Ruby.
  • Performance
  • Embedded Database – no database tier, easier to install, test, deploy and configure. It is run in the same process as your application.
  • Express Queries as Traversals or Cypher DSL
    • Fast deep traversal instead of slow SQL queries that span many table joins.
    • Very natural to express graph related problem with traversals (recommendation engine, find shortest parth etc..)
  • ACID Transaction with rollbacks support.
Clone this wiki locally