Thinking Graph ( Neo4j )

Graph theory has been around since the XVII century started by Leonhard Euler. Over the last decade, Graph databases have skyrocketed in popularity, at least, accordingly to With that, Neo4j has been in the forefront of the trend maintaining its growth and popularity. At the time of this post Neo4j has just released Neo4j 3.0 Milestone 1 which includes a native driver and bolt protocol.

Deploying Neo4j

There are a few options in this regard with their own flavors:

For the project I am currently working on, I chose for GrapheneDB with AWS, but it is also available as Heroku add on.

Querying Neo4j with Cypher

Cypher relays on relationships to traverse through nodes. This query language is capable of querying millions of node in one second. It can perform complex queries. For the scope of this post, I will only go over basic examples:

CREATE (n) RETURN (n) → creates an empty node

CREATE (juan:Person {name:”Juan”}) RETURN (juan) → creates a node with a Person label and a name property.

CREATE (juan:Person {name:”Juan”}), (carl:Person {name:”Carl”})

MERGE (juan) -[r:brother]-> (carl) RETURN juan, carl, r

View of Neo4j browser console. This is the result of the above query creating two nodes with a brother relationship

Example of a complex relationship with a simple query:

Key Takeaways

  • Graph databases organize nodes with relationships
  • Neo4j provides flexible and dynamic schemas
  • Deploy to AWS or Heroku using GrapheneDB


One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.