Neo4j Heroku アドオン

Neo4j Wiki から

The Neo4j graph database is a kind of NoSQL database services that manages its data as nodes connected via relationships, both able to carry property data. Neo4j offers fast manual and declarative traversal and direct index access. The add-on provides access to a Neo4j server (cluster) via a REST interface.


[edit] Local setup

To use the service locally, install your Neo4j server binary and start the service. You can access the REST API using generic gems like rest-client or HttpParty or use a dedicated gem like neography.

[edit] Rest-Client Example

   puts RestClient.get "#{ENV['NEO4J_URL']}/db/data/", :accept => :json

[edit] Neography Example

   @neo ={
       :server => ENV['NEO4J_HOST'],
       :directory => "/"+ENV['NEO4J_INSTANCE'],
       :authentication => 'basic',
       :username => ENV['NEO4J_LOGIN'] , 
       :password => ENV['NEO4J_PASSWORD']
   puts @neo.get_root.inspect

[edit] Further reading:

[edit] Deploying to Heroku

To use the Neo4j-Server via REST on Heroku, install the neo4j add-on:

   $ heroku addons:add neo4j
Neo4j のサイト