neo4j : introduction to graph database

Post on 14-Jun-2015

317 Views

Category:

Software

1 Downloads

Preview:

Click to see full reader

DESCRIPTION

Neo4j is an open-source graph database, implemented in Java.

TRANSCRIPT

Neo4j:Introduction to Graph DB

Presenter: Manash Ranjan Rautray,QA,Mindfire SolutionsDate: 12/09/2014

Presenter: Manash Ranjan Rautray, Mindfire Solutions

Manash Ranjan Rautray, Software QA EngineerMindfire Solutions

Skills : WebDriver, Java, JUnit, Maven, Oracle 11G,Neo4j,Mongo DBCertifications : ISTQB Foundation Level, V-Skills Selenium Certified,MCP:70-480

Connect with Me :LinkedIn : http://in.linkedin.com/pub/manash-ranjan-rautray/60/9a5/528

Contact Me :Email :manash.rautray@mindfiresolutiosn.com

Skype: mfsi_manashr

About Me

Presenter: Manash Ranjan Rautray, Mindfire Solutions

The Path Forward:

What is a Graph ?

What is Neo4j ?

Building blocks of a Graph DB

Data Modelling: SQL vs Graph

Use case: Social Media

Cypher Query Language

Installation of Neo

What is Graph ?

Presenter: Manash Ranjan Rautray, Mindfire Solutions

This is a Graph

Presenter: Manash Ranjan Rautray, Mindfire Solutions

Twitter Social Graph

Presenter: Manash Ranjan Rautray, Mindfire Solutions

Internet Graph

Presenter: Manash Ranjan Rautray, Mindfire Solutions

A graph database...

2NO: not for charts & diagrams.

YES: for storing data that is structured as a graph.Remember linked lists, trees?Graphs are the general-purpose data structure.

“A relational database may tell you the average age of everyone in this session,but a graph database will tell you with whom you will be going for lunch.”

Presenter: Manash Ranjan Rautray, Mindfire Solutions

What is Neo4j?

Presenter: Manash Ranjan Rautray, Mindfire Solutions

Presenter: Manash Ranjan Rautray, Mindfire Solutions

Presenter: Manash Ranjan Rautray, Mindfire Solutions

open_source:true

language:’Swedish’

year:2007

The Property Graph of Neo4j:

Presenter: Manash Ranjan Rautray, Mindfire Solutions

Who is using Graph Databases?● Some big names using Graph Databases:○ Facebook - Open Graph Database○ Google - Knowledge Graph○ Twitter - FlockDB distributed graph Database○ Adobe○ Glassdoor○ JustDial○ CareerBuilder○ Indiatimes○ telenor○ hewlett packard○ T-Mobile○ Cisco

Presenter: Manash Ranjan Rautray, Mindfire Solutions

Why Neo4j?

● Fully Transactional (ACID)● Highly Agile● Best suited for data which is highly connected and have complex relationships.● Is supremely fast when it comes to querying connected data● Highly scalable, up to several billion nodes/relationships/properties● Neo4j allows infinite depth● Data Modeling in Neo4j :

The whole model relies on the questions we have to ask our database

Very easily done, even when designing domains in SQL we tend to make graphs on whiteboards.

Presenter: Manash Ranjan Rautray, Mindfire Solutions

Neo4j vs. Mysql● for the simple friends of friends query, Neo4j is 60% faster than

MySQL● for friends of friends of friends, Neo is 180 times faster● and for the depth four query, Neo4j is 1,135 times faster● and MySQL just chokes on the depth 5 query

Presenter: Manash Ranjan Rautray, Mindfire Solutions

Presenter: Manash Ranjan Rautray, Mindfire Solutions

Data Modeling : SQL vs. Graph

Presenter: Manash Ranjan Rautray, Mindfire Solutions

Example: YouTube in SQL

ID Name

1 Alice

2 Bob

3 Charles

4 David

ID Name

1 Bob’s Gaming Channel

2 Bob’s Cute Dog

3 Cooking with Charles

4 David’s How-To Channel

5 Disco Dancing with David

User ID

Channel ID

2 1

2 2

3 3

4 4

4 5

USERS

CHANNELSUSERS_CHANNELS

User ID

Channel ID

1 3

1 4

2 3

2 5

3 1

USERS_SUBSCRIPTIONS

Presenter: Manash Ranjan Rautray, Mindfire Solutions

User

Channel Example: YouTube in a Graphname:’David’

name:’David’s How-To Channel’

OPERATES

name:’Disco Dancing with David’

name:’Bob’

name:’Bob’s Cute Dog’

name:’Bob’s Gaming Channel’

name:’Charles’name:’Cooking with Charles’

name:’Alice’

OPERATES SUBSCRIBEDOPERATES

OPERATES

OPERATESSUBSCRIBED

SUBSCRIBED

SUBSCRIBED

SUBSCRIBED

Presenter: Manash Ranjan Rautray, Mindfire Solutions

Use Case: Social Media

Presenter: Manash Ranjan Rautray, Mindfire Solutions

Presenter: Manash Ranjan Rautray, Mindfire Solutions

Presenter: Manash Ranjan Rautray, Mindfire Solutions

Presenter: Manash Ranjan Rautray, Mindfire Solutions

Cypher Query Language● Is a declarative query language for querying Neo4j● Expressive and Human readable syntax● Matches patterns of nodes and relationships toextract/modify information in the graph● With cypher, we can create, update, removenodes, relationships and properties● Has an online console at http://www.neo4j.org/console● Has a short learning curve due to similarities withSQL query statements

Presenter: Manash Ranjan Rautray, Mindfire Solutions

Cypher Query Language

Create a Node:

CREATE (n:Actor { name:"Tom Hanks",age:44 })

● Actor is the Label● n is the variable for new node● {} brackets to add properties to the node

Presenter: Manash Ranjan Rautray, Mindfire Solutions

Cypher Query Language

Read Properties of a Node:

MATCH (actor:Actor)WHERE actor.name="Tom HanksRETURN actor;

● Actor is the Label● actor is the variable for node● WHERE to restrict the result to ourcriteria● RETURN the properties on the node

Presenter: Manash Ranjan Rautray, Mindfire Solutions

Question and Answer

Presenter: Manash Ranjan Rautray, Mindfire Solutions

References

http://neo4j.com/docs/milestone/

http://neo4j.com/graphacademy/?gclid=CJ_Mn56e3b8CFXNo7AodVDoAkAhttps://www.youtube.com/watch?v=7Fsfa5DP9sE

groups.google.com/group/neo4j

Thank you

Presenter: Manash Ranjan Rautray, Mindfire Solutions

www.mindfiresolutions.com

https://www.facebook.com/MindfireSolutions

http://www.linkedin.com/company/mindfire-solutions

http://twitter.com/mindfires

top related