Jan 07, 2014

Neo4j Explained in 5 Minutes or Less

Steven Gangstead

Steven Gangstead

Default image background

Neo4j is a database designed around relationships.  Instead of fixed relations between tables, storage and retrieval is based on the interconnections between data.  Neo4j is the most used graph database, a category of NoSQL databases.  It is open source and backed by Neo Technology.  In a graph database, data points are arbitrarily connected to each other and both the points (called nodes) and directional relationships have properties that describe them.  This is different than traditional relational databases where tables of data all have the same form, have fixed relationships to other tables of data, and the relationships themselves do not have any properties.

Common Use Cases

Any time your data is semi-structured, large volume, or highly associative you can leverage graph search.  The stand out use cases are:

Social Networks – People and the relationships between them are perfectly suited to graph databases.  Queries that would cripple a relational system like second degree friends (friends of friends) are straightforward in a graph database and Neo4j’s Cypher query language is easy to read and understand.

Recommendation Engines – With a graph database you can use your connected data to benefit your customers.  Neo4j offers the power and speed to keep up with the growth of your data.

Geo Routing – Imagine modeling the classic traveling salesman problem of trying to visit each city on a map exactly once with the shortest route.  The data model is a map of cities and the routes between them and is already a graph.  Applications like routing inventory, scheduling tours and geospatial analysis are more comprehensible by developers and business owners in Neo4j compared to a relational database.  Performance also goes from “minutes to milliseconds” without relying on extra lookups to indices during retrieval.

Key Features

Reliable – Fully ACID compliant, scalable to billions of nodes, distributed options. ACID (Atomicity, Consistency, Isolation, Durability) compliance is a guarantee of data reliability.  Operational reliability is attained through online backups and clustering.

Framework support – While implemented in Java there are drivers for all major frameworks: Node.js, Scala, Java, Spring, Ruby On Rails, Ruby, PHP, .NET, Python, and many others.  There is also a REST API so that anything capable of making HTTP requests can access a Neo4j database.

Dual License – The dual license model gives a lot of flexibility for using Neo4j.  There is a GPL for open source projects so there’s a big community of support.  Commercial licenses allow for closed source projects, are free for personal use, add production support, and scale with enterprise size.

Companies Using Neo4j

Glassdoor – Uses Neo4j to power their InsideConnections system to search users’ Facebook network to find out who they know within a company and to give them more relevant job recommendations.

Cisco Systems – Models their entire sales organization in a versioned graph database.  They use Neo4j to run monitoring algorithms in real time to monitor performance and detect conflicts.

Gamesys Ltd – This UK based company uses Neo4j to track player interactions and referral bonuses.

Take Away

  • Graph databases are well suited to model highly associative data such as relationships between people or products.  Graph queries using Neo4j’s Cypher language can be orders of magnitude faster than a relational database modeling the same data.

  • Neo4j’s graph database protects data integrity and is fully ACID compliant.

  • With its extensive framework support and REST API, it is simple to integrate with existing applications and architectures.

If you have questions or comments, feel free to post in the comment section below or contact us at You can also follow us on Twitter at @CrederaOpen or connect with us on LinkedIn.

Conversation Icon

Contact Us

Ready to achieve your vision? We're here to help.

We'd love to start a conversation. Fill out the form and we'll connect you with the right person.

Searching for a new career?

View job openings