Live

The Doctor has been captured in a graph.

See all the characters, actors, and even some of the props.

Neo4j's Tardis

Neo4j: the Graph Database

You know relational, now consider relationships

Have happier data, and even happier users

Be social, recommend better, make sense of data

Try Neo4j right now on Heroku. It's easy:

product

Getting Started

Learn about Neo4j

Neo4j is a graph database. Records are called nodes and the connections between records are first-class citizens called relationships.

Neo4j refers to all of this as a Property Graph — nodes and relationships with key-value properties on both.

Querying is performed through a traversal, using the humane Cypher query language. It's like a friendly, pattern-matching version of SQL.

On Heroku

  1. Join Heroku, then prepare your developer environment
  2. Create a new Heroku app, using the Neo4j Add-on:
    // Create the application
    heroku apps:create {app name}
    // Include the Neo4j Add-on
    heroku addons:add neo4j --app {app name}
  3. Pick a Neo4j REST driver (see the sidebar)
  4. Provide the NEO4J_REST_URL environment variable to the driver
  5. Get graphy with your application

Neo4j Drivers

* Drivers should support Neo4j 1.6+REST. Did we miss one? Let us know in the comments.

Relational to Relationships

Ye Olde Join Table

This you already know

That the "relational" in RDBMS is simply a foreign key, a fairly humble reference to another record. Typically the column will be the same as the primary key in the other table, and the constraint will say something about the connection. To provide more information, use a...

Join table

Buried in the schema of every relational database on the planet, one or more join tables lurk. While the convention adds valuable information about how records relate, queries across multiple joins on large data sets can cause join pain.

Now, consider graph relationships.

Join Table

Graph Relationships

Relationships as first-class citizens

In a graph database like Neo4j, relationships are essential data elements. Down to the bare metal, Neo4j is optimized for managing the relationships between records, resulting in queries that are 1000x faster.

How can it be that much faster?

In a graph traversal, only the local data affects the query speed, and because relationships are materialized as actual structures, finding local data is extremely fast. And, it isn't affected by the growth of the entire data set. What happens to your RDBMS join queries when the data set grows?

Graph Relationships

Bootstrap Your App

Gensen is a repository of Heroku project templates. These fully working example applications include just enough code to demonstrate how to use a particular combination of Language, Framework and Add-ons.

After signing in, you can easily browse the available templates, rate them, or elect to share one of your own projects. Many of the templates were contributed as part of the Neo4j Challenge on Heroku. You can read more about the challenge and the winners on the Neo4j Blog about it.

  • Any language: Ruby, Java, Python, Javascript
  • Popular frameworks: Rails, Spring, Django, Express
  • Every add-on: look for the one spelled N-E-O-4-J

All you need to get started is an account on Heroku.

book

use a template

  1. Go to Gensen, logging in to your Heroku account
  2. Select your preferred language, framework and other features
  3. (optional) Give a rating and leave comments about some templates
  4. Click the "clone" button next to the template that catches your eye

Congratulations! A fresh clone of the template project will be created for you, ready to use and easily customized for your own clever purposes.

share a project

  1. Go to Gensen, logging in to your Heroku account
  2. Follow the "Share your Applications" button
  3. Select one of your existing Heroku apps, hit "Share"
  4. Customize the "Share an App" form, then submit

Thanks! You will have very generously contributed to saving the planet by reducing the amount of energy wasted when starting a project from scratch.

Querying Live Data

Live on Neo4j

The Wednesday track of NoSQL Now has been captured in a Neo4j Graph, deployed on Heroku. Neo4j's Webadmin is an easy way to get familiar with data and experiment with queries.

Check it out live right now:*

  • Dashboard: an overview of the database, with vital stats and a chart showing change over time
  • Data browser: data inspector and visualizer (use the righmost button in the toolbar to toggle)
  • Console: a REPL for running Cypher queries, or testing out REST API calls

*Note that you may get a phishing warning because we've encoded the password in these URLs.

Try these Cypher queries on the live data

  1. All talks:
    start n=node(0) match n--m--talks return count(talks);
  2. Graph database track:
    start t=node:tags(tag="Graph Databases") match t<-[:tagged]-talk-[:at]->slot return talk order by slot.slot desc;
  3. People from Neo Technology:
    start c=node:companies(company="Neo Technology") match c<-[:works_at]-p return p;

 

Discuss

blog comments powered by Disqus

Learn more about Neo4j out on the intertubes:

  • Twitter
  • Twitter
  • You Tube
  • Linked In

Contact us directly:

info@neo4j.org