Sunday, June 17, 2012

Graph Database - Neo4j

I have been studying graph databases for last few days for my new company, and Neo4j guys have done a pretty amazing job. If you are not very familiar with graph databases, think of them as a database to represent relationships between objects.

Since the real world relationships are very complex to represent in a regular relational databases, NOSQL databases come to the rescue.

Use case:

  • User 1 is a friend of User 2
  • User 1 is a man
  • User 1 lives in San Francisco
  • User 1 likes Netflix
  • User 1 watched movie seven
  • Users 1 traveled to Paris
The set of properties associated with user 1 like, he is a man and lives in San francisco and the relationships to other objects like is a friend of user 2 and likes object Netflix are very complex to represent in regular relational databases like MySQL. 

NOSQL databases are of 4 kinds, based on the use case. 

1. Key value
2. Column databases
3. document databases
4. graph databases

The above use case is best represented in a graph database. You can get more details by watching http://www.youtube.com/watch?NR=1&feature=endscreen&v=BFTLOABf5oY youtube video.

I will continue writing more as I explore it further.