SlideShare ist ein Scribd-Unternehmen logo
1 von 53
Introduction to
Neo4j
By: Suveeksha Jain
Mtech 2 sem
Agenda
• Trends in Data
• NOSQL
• What is a Graph?
• What is a Graph Database?
• What is Neo4j?
Trends in Data
Data is getting bigger:
“Every 2 days we
create as much
information as we did
up to 2003”
– Eric Schmidt, Google
NOSQL
Not Only SQL
Less than 10% of the NOSQL Vendors
Types of NoSQL data base
• Key-value database
• Document database
• Column family stores
• Graph database
Key Value Stores
• Most Based on Dynamo: Amazon Highly
Available Key-Value Store
• Data Model:
– Global key-value mapping
– Big scalable HashMap
– Highly fault tolerant (typically)
• Examples:
– Redis, Riak, Voldemort.
Key value database
Key Value Stores: Pros and Cons
• Pros:
– Simple data model
– Scalable
• Cons
– Create your own “foreign keys”
– Poor for complex data
Column Family
• Most Based on BigTable: Google’s Distributed
Storage System for Structured Data
• Data Model:
– A big table, with column families
– Map Reduce for querying/processing
• Examples:
– HBase, HyperTable, Cassandra
Column Family: Pros and Cons
• Pros:
– Supports Simi-Structured Data
– Naturally Indexed (columns)
– Scalable
• Cons
– Poor for interconnected data
Document Databases
• Data Model:
– A collection of documents
– A document is a key value collection
– Index-centric, lots of map-reduce
• Examples:
– CouchDB, MongoDB
Document Databases: Pros and Cons
• Pros:
– Simple, powerful data model
– Scalable
• Cons
– Poor for interconnected data
– Query model limited to keys and indexes
– Map reduce for larger queries
Graph Databases
• Data Model:
– Nodes and Relationships
• Examples:
– Neo4j, OrientDB, InfiniteGraph, AllegroGraph
Graph Databases: Pros and Cons
• Pros:
– Powerful data model, as general as RDBMS
– Connected data locally indexed
– Easy to query
• Cons
– Sharding ( lots of people working on this)
• Scales UP reasonably well
What is a Graph?
What is a Graph?
• An abstract representation of a set of objects
where some pairs are connected by links.
Object (Vertex, Node)
Link (Edge, Arc, Relationship)
Different Kinds of Graphs
• Undirected Graph
• Directed Graph
• Pseudo Graph
• Multi Graph
• Hyper Graph
More Kinds of Graphs
• Weighted Graph
• Labeled Graph
• Property Graph
What is a Graph Database?
• A database with an explicit graph structure
• Each node knows its adjacent nodes
• As the number of nodes increases, the cost of
a local step (or hop) remains the same
• Plus an Index for lookups
Compared to Relational Databases
Optimized for aggregation Optimized for connections
Compared to Key Value Stores
Optimized for simple look-ups Optimized for traversing connected data
Compared to Key Value Stores
Optimized for “trees” of data Optimized for seeing the forest and the
trees, and the branches, and the trunks
What is Neo4j?
What is Neo4j?
• A Graph Database + Lucene Index
• Full ACID (atomicity, consistency, isolation,
durability)
• A schema-free labeled Property Graph
• High Availability (with Enterprise Edition)
• perfect for complex, highly connected data
The property graph model
๏Core abstractions:
•Nodes
•Relationships between nodes
•Properties on both
๏ Traversal framework
• High performance
queries on connected
data sets
name = “Jordi”
age = 29
type = KNOWS
time = 4 years
type = car
vendor = “Honda”
model = “Civic”
Good For
• Highly connected data (social networks)
• Recommendations (e-commerce)
• Path Finding (how do I know you?)
• A* (Least Cost path)
• Data First Schema (bottom-up, but you still
need to design)
Ten Reasons for Choosing Neo4j
• World’s Best and First Graph Database
• Biggest and Most Active Graph Community on the
Planet
o 1,000,000+ downloads, adding 50,000 downloads per month
o 20,000+ graph education registrants
o 20,000+ Meetup members
o 500+ Neo4j events per year
o 100+ technology and service partners
o 200 enterprise subscription customers, including 50+ of the Global 2000
• Highly Performant Read and Write Scalability, Without
Compromise
• High Performance Thanks to Native Graph Storage &
Processing
• Easy to Learn
• Easy to Use
• Easier than Ever to Load Your Data into Neo4j
• Whiteboard-friendly Data Modeling to Simplify the
Development Cycle
• Superb Value for Enterprise and Startup Projects
Property Graph
// then traverse to find results
start n=(people-index, name, “Andreas”)
match (n)--()--(foaf) return foaf
n
Cypher
// get node 0
start a=(0) return a
// traverse from node 1
start a=(1) match (a)-->(b) return b
// return friends of friends
start a=(1) match (a)--()--(c) return c
Pattern Matching Query Language (like SQL for graphs)
Social data (customer: brand-name social network)
name = “Mike”
age = 29
disclosure = public
name = “Charlie”
last_name =
“Runkle”
name = “Dani”
last_name =
“California”
age = 27
KNOWS
name = “Hank”
last_name = “Moody”
age = 42
age = 3 days
name =
“Karen”
KNOWS
name = “Marcy Runkle”
Spatial data (customer: large telecom company)
name = “Omni Hotel”
lat = 3492848
long = 283823423 length = 7 miles
name = ...
lat, long = ...
name = “Swedland”
lat = 23410349
long = 2342348852
ROAD
name = “The Tavern”
lat = 1295238237
long = 234823492
length = 3 miles
name = ...
ROAD
name = ...
Social AND spatial data
name = “Omni Hotel”
lat = 3492848
long = 283823423 weight = 10
name = “Pere”
beer_qual = expert
name = “Maria”
age = 30
beer_qual = non-
existant
LIKES
name = “The Tavern”
lat = 1295238237
long = 234823492
length = 3 miles
name = ...
ROAD
name = “Jordi”
Query structure
MATCH (n:Label)-[:REL]->(m:Label)
WHERE n.prop < 42
WITH n, count(m) as cnt,
collect(m.attr) as attrs
WHERE cnt > 12
RETURN n.prop,
extract(a2 in
filter(a1 in attrs
WHERE a1 =~ "...-.*")
| substr(a2,4,size(a2)-1)]
AS ids
ORDER BY length(ids) DESC
LIMIT 10
MATCH
describes the pattern
MATCH (n:Label)-[:REL]->(m:Label)
WHERE n.prop < 42
WITH n, count(m) as cnt,
collect(m.attr) as attrs
WHERE cnt > 12
RETURN n.prop,
extract(a2 in
filter(a1 in attrs
WHERE a1 =~ "...-.*")
| substr(a2,4,size(a2)-1)]
AS ids
ORDER BY length(ids) DESC
SKIP 5 LIMIT 10
WHERE
filters the result set
MATCH (n:Label)-[:REL]->(m:Label)
WHERE n.prop < 42
WITH n, count(m) as cnt,
collect(m.attr) as attrs
WHERE cnt > 12
RETURN n.prop,
extract(a2 in
filter(a1 in attrs
WHERE a1 =~ "...-.*")
| substr(a2,4,size(a2)-1)]
AS ids
ORDER BY length(ids) DESC
SKIP 5 LIMIT 10
RETURN
returns the result rows
MATCH (n:Label)-[:REL]->(m:Label)
WHERE n.prop < 42
WITH n, count(m) as cnt,
collect(m.attr) as attrs
WHERE cnt > 12
RETURN n.prop,
extract(a2 in
filter(a1 in attrs
WHERE a1 =~ "...-.*")
| substr(a2,4,size(a2)-1)]
AS ids
ORDER BY length(ids) DESC
SKIP 5 LIMIT 10
ORDER BY
LIMIT SKIP
sort and paginate
MATCH (n:Label)-[:REL]->(m:Label)
WHERE n.prop < 42
WITH n, count(m) as cnt,
collect(m.attr) as attrs
WHERE cnt > 12
RETURN n.prop,
extract(a2 in
filter(a1 in attrs
WHERE a1 =~ "...-.*")
| substr(a2,4,size(a2)-1)]
AS ids
ORDER BY length(ids) DESC
SKIP 5 LIMIT 10
WITH
combines query parts
like a pipe
MATCH (n:Label)-[:REL]->(m:Label)
WHERE n.prop < 42
WITH n, count(m) as cnt,
collect(m.attr) as attrs
WHERE cnt > 12
RETURN n.prop,
extract(a2 in
filter(a1 in attrs
WHERE a1 =~ "...-.*")
| substr(a2,4,size(a2)-1)]
AS ids
ORDER BY length(ids) DESC
SKIP 5 LIMIT 10
Collections
powerful datastructure
handlingMATCH (n:Label)-[:REL]->(m:Label)
WHERE n.prop < 42
WITH n, count(m) as cnt,
collect(m.attr) as attrs
WHERE cnt > 12
RETURN n.prop,
extract(a2 in
filter(a1 in attrs
WHERE a1 =~ "...-.*")
| substr(a2,4,size(a2)-1)]
AS ids
ORDER BY length(ids) DESC
LIMIT 10
CREATE
creates nodes, relationships
and patterns
CREATE - nodes, rels, structures
CREATE (y:Year {year:2014})
FOREACH (m IN range(1,12) |
CREATE
(:Month {month:m})-[:IN]->(y)
)
MERGE
matches or creates
MERGE (y:Year {year:2014})
ON CREATE
SET y.created = timestamp()
FOREACH (m IN range(1,12) |
MERGE
(:Month {month:m})-[:IN]->(y)
)
SET, REMOVE
update attributes and labels
MATCH (year:Year)
WHERE year.year % 4 = 0 OR
year.year % 100 <> 0 AND
year.year % 400 = 0
SET year:Leap
WITH year
MATCH (year)<-[:IN]-(feb:Month {month:2})
SET feb.days = 29
CREATE (feb)<-[:IN]-(:Day {day:29})
Neo4j Data Browser
Neo4j Console
Uses
Thank you!

Weitere ähnliche Inhalte

Was ist angesagt?

Importing Data into Neo4j quickly and easily - StackOverflow
Importing Data into Neo4j quickly and easily - StackOverflowImporting Data into Neo4j quickly and easily - StackOverflow
Importing Data into Neo4j quickly and easily - StackOverflowNeo4j
 
Strata Presentation: One Billion Objects in 2GB: Big Data Analytics on Small ...
Strata Presentation: One Billion Objects in 2GB: Big Data Analytics on Small ...Strata Presentation: One Billion Objects in 2GB: Big Data Analytics on Small ...
Strata Presentation: One Billion Objects in 2GB: Big Data Analytics on Small ...randyguck
 
Pivoting Data with SparkSQL by Andrew Ray
Pivoting Data with SparkSQL by Andrew RayPivoting Data with SparkSQL by Andrew Ray
Pivoting Data with SparkSQL by Andrew RaySpark Summit
 
Hands on Training – Graph Database with Neo4j
Hands on Training – Graph Database with Neo4jHands on Training – Graph Database with Neo4j
Hands on Training – Graph Database with Neo4jSerendio Inc.
 
Spark Dataframe - Mr. Jyotiska
Spark Dataframe - Mr. JyotiskaSpark Dataframe - Mr. Jyotiska
Spark Dataframe - Mr. JyotiskaSigmoid
 
N1QL New Features in couchbase 7.0
N1QL New Features in couchbase 7.0N1QL New Features in couchbase 7.0
N1QL New Features in couchbase 7.0Keshav Murthy
 
Introduction to Vertica (Architecture & More)
Introduction to Vertica (Architecture & More)Introduction to Vertica (Architecture & More)
Introduction to Vertica (Architecture & More)LivePerson
 
Introduction to graph databases, Neo4j and Spring Data - English 2015 Edition
Introduction to graph databases, Neo4j and Spring Data - English 2015 EditionIntroduction to graph databases, Neo4j and Spring Data - English 2015 Edition
Introduction to graph databases, Neo4j and Spring Data - English 2015 EditionAleksander Stensby
 
SparkSQL and Dataframe
SparkSQL and DataframeSparkSQL and Dataframe
SparkSQL and DataframeNamgee Lee
 
Getting started with Graph Databases & Neo4j
Getting started with Graph Databases & Neo4jGetting started with Graph Databases & Neo4j
Getting started with Graph Databases & Neo4jSuroor Wijdan
 
Graph Databases
Graph DatabasesGraph Databases
Graph Databasesthai
 
Introduction to Graph Databases
Introduction to Graph DatabasesIntroduction to Graph Databases
Introduction to Graph DatabasesMax De Marzi
 
Vancouver AWS Meetup Slides 11-20-2018 Apache Spark with Amazon EMR
Vancouver AWS Meetup Slides 11-20-2018 Apache Spark with Amazon EMRVancouver AWS Meetup Slides 11-20-2018 Apache Spark with Amazon EMR
Vancouver AWS Meetup Slides 11-20-2018 Apache Spark with Amazon EMRAllice Shandler
 
Introducing Neo4j 3.0
Introducing Neo4j 3.0Introducing Neo4j 3.0
Introducing Neo4j 3.0Neo4j
 
Munich March 2015 - Cassandra + Spark Overview
Munich March 2015 -  Cassandra + Spark OverviewMunich March 2015 -  Cassandra + Spark Overview
Munich March 2015 - Cassandra + Spark OverviewChristopher Batey
 
Getting started with pandas
Getting started with pandasGetting started with pandas
Getting started with pandasmaikroeder
 

Was ist angesagt? (20)

Graph databases
Graph databasesGraph databases
Graph databases
 
Importing Data into Neo4j quickly and easily - StackOverflow
Importing Data into Neo4j quickly and easily - StackOverflowImporting Data into Neo4j quickly and easily - StackOverflow
Importing Data into Neo4j quickly and easily - StackOverflow
 
Strata Presentation: One Billion Objects in 2GB: Big Data Analytics on Small ...
Strata Presentation: One Billion Objects in 2GB: Big Data Analytics on Small ...Strata Presentation: One Billion Objects in 2GB: Big Data Analytics on Small ...
Strata Presentation: One Billion Objects in 2GB: Big Data Analytics on Small ...
 
Pivoting Data with SparkSQL by Andrew Ray
Pivoting Data with SparkSQL by Andrew RayPivoting Data with SparkSQL by Andrew Ray
Pivoting Data with SparkSQL by Andrew Ray
 
Hands on Training – Graph Database with Neo4j
Hands on Training – Graph Database with Neo4jHands on Training – Graph Database with Neo4j
Hands on Training – Graph Database with Neo4j
 
Spark Dataframe - Mr. Jyotiska
Spark Dataframe - Mr. JyotiskaSpark Dataframe - Mr. Jyotiska
Spark Dataframe - Mr. Jyotiska
 
N1QL New Features in couchbase 7.0
N1QL New Features in couchbase 7.0N1QL New Features in couchbase 7.0
N1QL New Features in couchbase 7.0
 
Introduction to Vertica (Architecture & More)
Introduction to Vertica (Architecture & More)Introduction to Vertica (Architecture & More)
Introduction to Vertica (Architecture & More)
 
Neo4j in Depth
Neo4j in DepthNeo4j in Depth
Neo4j in Depth
 
Introduction to graph databases, Neo4j and Spring Data - English 2015 Edition
Introduction to graph databases, Neo4j and Spring Data - English 2015 EditionIntroduction to graph databases, Neo4j and Spring Data - English 2015 Edition
Introduction to graph databases, Neo4j and Spring Data - English 2015 Edition
 
SparkSQL and Dataframe
SparkSQL and DataframeSparkSQL and Dataframe
SparkSQL and Dataframe
 
Getting started with Graph Databases & Neo4j
Getting started with Graph Databases & Neo4jGetting started with Graph Databases & Neo4j
Getting started with Graph Databases & Neo4j
 
Graph Databases
Graph DatabasesGraph Databases
Graph Databases
 
Introduction to Graph Databases
Introduction to Graph DatabasesIntroduction to Graph Databases
Introduction to Graph Databases
 
Vancouver AWS Meetup Slides 11-20-2018 Apache Spark with Amazon EMR
Vancouver AWS Meetup Slides 11-20-2018 Apache Spark with Amazon EMRVancouver AWS Meetup Slides 11-20-2018 Apache Spark with Amazon EMR
Vancouver AWS Meetup Slides 11-20-2018 Apache Spark with Amazon EMR
 
AWS Webcast - Dynamo DB
AWS Webcast - Dynamo DBAWS Webcast - Dynamo DB
AWS Webcast - Dynamo DB
 
Introducing Neo4j 3.0
Introducing Neo4j 3.0Introducing Neo4j 3.0
Introducing Neo4j 3.0
 
Munich March 2015 - Cassandra + Spark Overview
Munich March 2015 -  Cassandra + Spark OverviewMunich March 2015 -  Cassandra + Spark Overview
Munich March 2015 - Cassandra + Spark Overview
 
Deep Dive on Amazon DynamoDB
Deep Dive on Amazon DynamoDBDeep Dive on Amazon DynamoDB
Deep Dive on Amazon DynamoDB
 
Getting started with pandas
Getting started with pandasGetting started with pandas
Getting started with pandas
 

Andere mochten auch

15 smart online public relation pr tips for global paint industries
15 smart online public relation pr tips for global paint industries15 smart online public relation pr tips for global paint industries
15 smart online public relation pr tips for global paint industriesSocial Bubble
 
Etude Apec - L'insertion professionnelle des jeunes diplômés : promotion 2014
Etude Apec - L'insertion professionnelle des jeunes diplômés : promotion 2014Etude Apec - L'insertion professionnelle des jeunes diplômés : promotion 2014
Etude Apec - L'insertion professionnelle des jeunes diplômés : promotion 2014Apec
 
El imperio napoleónico betzabe
El imperio napoleónico betzabeEl imperio napoleónico betzabe
El imperio napoleónico betzabebetsy_2014
 
dimer optical properties
dimer optical propertiesdimer optical properties
dimer optical propertiesAnuj012
 
Nme music mag analysis ppt
Nme music mag analysis pptNme music mag analysis ppt
Nme music mag analysis ppt10-klam
 
Experimento del neutrón
Experimento del neutrónExperimento del neutrón
Experimento del neutrónAarón Valencia
 

Andere mochten auch (10)

15 smart online public relation pr tips for global paint industries
15 smart online public relation pr tips for global paint industries15 smart online public relation pr tips for global paint industries
15 smart online public relation pr tips for global paint industries
 
Etude Apec - L'insertion professionnelle des jeunes diplômés : promotion 2014
Etude Apec - L'insertion professionnelle des jeunes diplômés : promotion 2014Etude Apec - L'insertion professionnelle des jeunes diplômés : promotion 2014
Etude Apec - L'insertion professionnelle des jeunes diplômés : promotion 2014
 
Panneaux PVC plein
Panneaux PVC pleinPanneaux PVC plein
Panneaux PVC plein
 
El imperio napoleónico betzabe
El imperio napoleónico betzabeEl imperio napoleónico betzabe
El imperio napoleónico betzabe
 
dimer optical properties
dimer optical propertiesdimer optical properties
dimer optical properties
 
Nme music mag analysis ppt
Nme music mag analysis pptNme music mag analysis ppt
Nme music mag analysis ppt
 
Amistat1
Amistat1Amistat1
Amistat1
 
AI
AIAI
AI
 
Corruption
CorruptionCorruption
Corruption
 
Experimento del neutrón
Experimento del neutrónExperimento del neutrón
Experimento del neutrón
 

Ähnlich wie managing big data

The openCypher Project - An Open Graph Query Language
The openCypher Project - An Open Graph Query LanguageThe openCypher Project - An Open Graph Query Language
The openCypher Project - An Open Graph Query LanguageNeo4j
 
An R primer for SQL folks
An R primer for SQL folksAn R primer for SQL folks
An R primer for SQL folksThomas Hütter
 
Graph Databases in the Microsoft Ecosystem
Graph Databases in the Microsoft EcosystemGraph Databases in the Microsoft Ecosystem
Graph Databases in the Microsoft EcosystemMarco Parenzan
 
Graph databases and the #panamapapers
Graph databases and the #panamapapersGraph databases and the #panamapapers
Graph databases and the #panamapapersdarthvader42
 
Graph Databases & OrientDB
Graph Databases & OrientDBGraph Databases & OrientDB
Graph Databases & OrientDBArpit Poladia
 
Combine Spring Data Neo4j and Spring Boot to quickl
Combine Spring Data Neo4j and Spring Boot to quicklCombine Spring Data Neo4j and Spring Boot to quickl
Combine Spring Data Neo4j and Spring Boot to quicklNeo4j
 
FOSDEM 2014: Social Network Benchmark (SNB) Graph Generator
FOSDEM 2014:  Social Network Benchmark (SNB) Graph GeneratorFOSDEM 2014:  Social Network Benchmark (SNB) Graph Generator
FOSDEM 2014: Social Network Benchmark (SNB) Graph GeneratorLDBC council
 
Graphs fun vjug2
Graphs fun vjug2Graphs fun vjug2
Graphs fun vjug2Neo4j
 
Processing Large Graphs
Processing Large GraphsProcessing Large Graphs
Processing Large GraphsNishant Gandhi
 
Introduction to R for data science
Introduction to R for data scienceIntroduction to R for data science
Introduction to R for data scienceLong Nguyen
 
Large Scale Machine Learning with Apache Spark
Large Scale Machine Learning with Apache SparkLarge Scale Machine Learning with Apache Spark
Large Scale Machine Learning with Apache SparkCloudera, Inc.
 
Introduction to Neo4j for the Emirates & Bahrain
Introduction to Neo4j for the Emirates & BahrainIntroduction to Neo4j for the Emirates & Bahrain
Introduction to Neo4j for the Emirates & BahrainNeo4j
 
Data Con LA 2022 - What's new with MongoDB 6.0 and Atlas
Data Con LA 2022 - What's new with MongoDB 6.0 and AtlasData Con LA 2022 - What's new with MongoDB 6.0 and Atlas
Data Con LA 2022 - What's new with MongoDB 6.0 and AtlasData Con LA
 
Introduction to SQL Server Graph DB
Introduction to SQL Server Graph DBIntroduction to SQL Server Graph DB
Introduction to SQL Server Graph DBGreg McMurray
 
Time Series Databases for IoT (On-premises and Azure)
Time Series Databases for IoT (On-premises and Azure)Time Series Databases for IoT (On-premises and Azure)
Time Series Databases for IoT (On-premises and Azure)Ivo Andreev
 
Graph Database and Neo4j
Graph Database and Neo4jGraph Database and Neo4j
Graph Database and Neo4jSina Khorami
 

Ähnlich wie managing big data (20)

Databases for Data Science
Databases for Data ScienceDatabases for Data Science
Databases for Data Science
 
The openCypher Project - An Open Graph Query Language
The openCypher Project - An Open Graph Query LanguageThe openCypher Project - An Open Graph Query Language
The openCypher Project - An Open Graph Query Language
 
An R primer for SQL folks
An R primer for SQL folksAn R primer for SQL folks
An R primer for SQL folks
 
Graph Databases in the Microsoft Ecosystem
Graph Databases in the Microsoft EcosystemGraph Databases in the Microsoft Ecosystem
Graph Databases in the Microsoft Ecosystem
 
Graph databases and the #panamapapers
Graph databases and the #panamapapersGraph databases and the #panamapapers
Graph databases and the #panamapapers
 
Graph Databases & OrientDB
Graph Databases & OrientDBGraph Databases & OrientDB
Graph Databases & OrientDB
 
Combine Spring Data Neo4j and Spring Boot to quickl
Combine Spring Data Neo4j and Spring Boot to quicklCombine Spring Data Neo4j and Spring Boot to quickl
Combine Spring Data Neo4j and Spring Boot to quickl
 
FOSDEM 2014: Social Network Benchmark (SNB) Graph Generator
FOSDEM 2014:  Social Network Benchmark (SNB) Graph GeneratorFOSDEM 2014:  Social Network Benchmark (SNB) Graph Generator
FOSDEM 2014: Social Network Benchmark (SNB) Graph Generator
 
Graphs fun vjug2
Graphs fun vjug2Graphs fun vjug2
Graphs fun vjug2
 
Processing Large Graphs
Processing Large GraphsProcessing Large Graphs
Processing Large Graphs
 
Introduction to R for data science
Introduction to R for data scienceIntroduction to R for data science
Introduction to R for data science
 
Large Scale Machine Learning with Apache Spark
Large Scale Machine Learning with Apache SparkLarge Scale Machine Learning with Apache Spark
Large Scale Machine Learning with Apache Spark
 
Presentation
PresentationPresentation
Presentation
 
Introduction to Neo4j for the Emirates & Bahrain
Introduction to Neo4j for the Emirates & BahrainIntroduction to Neo4j for the Emirates & Bahrain
Introduction to Neo4j for the Emirates & Bahrain
 
Data Con LA 2022 - What's new with MongoDB 6.0 and Atlas
Data Con LA 2022 - What's new with MongoDB 6.0 and AtlasData Con LA 2022 - What's new with MongoDB 6.0 and Atlas
Data Con LA 2022 - What's new with MongoDB 6.0 and Atlas
 
NoSQL
NoSQLNoSQL
NoSQL
 
NoSQL & JSON
NoSQL & JSONNoSQL & JSON
NoSQL & JSON
 
Introduction to SQL Server Graph DB
Introduction to SQL Server Graph DBIntroduction to SQL Server Graph DB
Introduction to SQL Server Graph DB
 
Time Series Databases for IoT (On-premises and Azure)
Time Series Databases for IoT (On-premises and Azure)Time Series Databases for IoT (On-premises and Azure)
Time Series Databases for IoT (On-premises and Azure)
 
Graph Database and Neo4j
Graph Database and Neo4jGraph Database and Neo4j
Graph Database and Neo4j
 

Mehr von Suveeksha

Wireless languages and content generation technologies
Wireless languages and content generation technologiesWireless languages and content generation technologies
Wireless languages and content generation technologiesSuveeksha
 
Open mp library functions and environment variables
Open mp library functions and environment variablesOpen mp library functions and environment variables
Open mp library functions and environment variablesSuveeksha
 
Data leakage detection
Data leakage detection Data leakage detection
Data leakage detection Suveeksha
 

Mehr von Suveeksha (6)

Wireless languages and content generation technologies
Wireless languages and content generation technologiesWireless languages and content generation technologies
Wireless languages and content generation technologies
 
web services
web servicesweb services
web services
 
San
SanSan
San
 
Open mp library functions and environment variables
Open mp library functions and environment variablesOpen mp library functions and environment variables
Open mp library functions and environment variables
 
Data leakage detection
Data leakage detection Data leakage detection
Data leakage detection
 
Raid level
Raid levelRaid level
Raid level
 

Kürzlich hochgeladen

Tree View Decoration Attribute in the Odoo 17
Tree View Decoration Attribute in the Odoo 17Tree View Decoration Attribute in the Odoo 17
Tree View Decoration Attribute in the Odoo 17Celine George
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxkarenfajardo43
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17Celine George
 
An Overview of the Calendar App in Odoo 17 ERP
An Overview of the Calendar App in Odoo 17 ERPAn Overview of the Calendar App in Odoo 17 ERP
An Overview of the Calendar App in Odoo 17 ERPCeline George
 
6 ways Samsung’s Interactive Display powered by Android changes the classroom
6 ways Samsung’s Interactive Display powered by Android changes the classroom6 ways Samsung’s Interactive Display powered by Android changes the classroom
6 ways Samsung’s Interactive Display powered by Android changes the classroomSamsung Business USA
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmStan Meyer
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Association for Project Management
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxSayali Powar
 
How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17Celine George
 
Sulphonamides, mechanisms and their uses
Sulphonamides, mechanisms and their usesSulphonamides, mechanisms and their uses
Sulphonamides, mechanisms and their usesVijayaLaxmi84
 
Scientific Writing :Research Discourse
Scientific  Writing :Research  DiscourseScientific  Writing :Research  Discourse
Scientific Writing :Research DiscourseAnita GoswamiGiri
 
How to Uninstall a Module in Odoo 17 Using Command Line
How to Uninstall a Module in Odoo 17 Using Command LineHow to Uninstall a Module in Odoo 17 Using Command Line
How to Uninstall a Module in Odoo 17 Using Command LineCeline George
 
CLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptxCLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptxAnupam32727
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...
BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...
BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...Nguyen Thanh Tu Collection
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfPrerana Jadhav
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Projectjordimapav
 

Kürzlich hochgeladen (20)

Tree View Decoration Attribute in the Odoo 17
Tree View Decoration Attribute in the Odoo 17Tree View Decoration Attribute in the Odoo 17
Tree View Decoration Attribute in the Odoo 17
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
 
prashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Professionprashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Profession
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17
 
An Overview of the Calendar App in Odoo 17 ERP
An Overview of the Calendar App in Odoo 17 ERPAn Overview of the Calendar App in Odoo 17 ERP
An Overview of the Calendar App in Odoo 17 ERP
 
6 ways Samsung’s Interactive Display powered by Android changes the classroom
6 ways Samsung’s Interactive Display powered by Android changes the classroom6 ways Samsung’s Interactive Display powered by Android changes the classroom
6 ways Samsung’s Interactive Display powered by Android changes the classroom
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and Film
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
 
How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17
 
Sulphonamides, mechanisms and their uses
Sulphonamides, mechanisms and their usesSulphonamides, mechanisms and their uses
Sulphonamides, mechanisms and their uses
 
Introduction to Research ,Need for research, Need for design of Experiments, ...
Introduction to Research ,Need for research, Need for design of Experiments, ...Introduction to Research ,Need for research, Need for design of Experiments, ...
Introduction to Research ,Need for research, Need for design of Experiments, ...
 
Scientific Writing :Research Discourse
Scientific  Writing :Research  DiscourseScientific  Writing :Research  Discourse
Scientific Writing :Research Discourse
 
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptxINCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
 
How to Uninstall a Module in Odoo 17 Using Command Line
How to Uninstall a Module in Odoo 17 Using Command LineHow to Uninstall a Module in Odoo 17 Using Command Line
How to Uninstall a Module in Odoo 17 Using Command Line
 
CLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptxCLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptx
 
Mattingly "AI & Prompt Design" - Introduction to Machine Learning"
Mattingly "AI & Prompt Design" - Introduction to Machine Learning"Mattingly "AI & Prompt Design" - Introduction to Machine Learning"
Mattingly "AI & Prompt Design" - Introduction to Machine Learning"
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...
BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...
BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdf
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Project
 

managing big data

  • 2. Agenda • Trends in Data • NOSQL • What is a Graph? • What is a Graph Database? • What is Neo4j?
  • 4. Data is getting bigger: “Every 2 days we create as much information as we did up to 2003” – Eric Schmidt, Google
  • 6. Less than 10% of the NOSQL Vendors
  • 7. Types of NoSQL data base • Key-value database • Document database • Column family stores • Graph database
  • 8. Key Value Stores • Most Based on Dynamo: Amazon Highly Available Key-Value Store • Data Model: – Global key-value mapping – Big scalable HashMap – Highly fault tolerant (typically) • Examples: – Redis, Riak, Voldemort.
  • 10. Key Value Stores: Pros and Cons • Pros: – Simple data model – Scalable • Cons – Create your own “foreign keys” – Poor for complex data
  • 11. Column Family • Most Based on BigTable: Google’s Distributed Storage System for Structured Data • Data Model: – A big table, with column families – Map Reduce for querying/processing • Examples: – HBase, HyperTable, Cassandra
  • 12.
  • 13. Column Family: Pros and Cons • Pros: – Supports Simi-Structured Data – Naturally Indexed (columns) – Scalable • Cons – Poor for interconnected data
  • 14. Document Databases • Data Model: – A collection of documents – A document is a key value collection – Index-centric, lots of map-reduce • Examples: – CouchDB, MongoDB
  • 15.
  • 16. Document Databases: Pros and Cons • Pros: – Simple, powerful data model – Scalable • Cons – Poor for interconnected data – Query model limited to keys and indexes – Map reduce for larger queries
  • 17. Graph Databases • Data Model: – Nodes and Relationships • Examples: – Neo4j, OrientDB, InfiniteGraph, AllegroGraph
  • 18. Graph Databases: Pros and Cons • Pros: – Powerful data model, as general as RDBMS – Connected data locally indexed – Easy to query • Cons – Sharding ( lots of people working on this) • Scales UP reasonably well
  • 19. What is a Graph?
  • 20. What is a Graph? • An abstract representation of a set of objects where some pairs are connected by links. Object (Vertex, Node) Link (Edge, Arc, Relationship)
  • 21. Different Kinds of Graphs • Undirected Graph • Directed Graph • Pseudo Graph • Multi Graph • Hyper Graph
  • 22. More Kinds of Graphs • Weighted Graph • Labeled Graph • Property Graph
  • 23. What is a Graph Database? • A database with an explicit graph structure • Each node knows its adjacent nodes • As the number of nodes increases, the cost of a local step (or hop) remains the same • Plus an Index for lookups
  • 24. Compared to Relational Databases Optimized for aggregation Optimized for connections
  • 25. Compared to Key Value Stores Optimized for simple look-ups Optimized for traversing connected data
  • 26. Compared to Key Value Stores Optimized for “trees” of data Optimized for seeing the forest and the trees, and the branches, and the trunks
  • 28.
  • 29. What is Neo4j? • A Graph Database + Lucene Index • Full ACID (atomicity, consistency, isolation, durability) • A schema-free labeled Property Graph • High Availability (with Enterprise Edition) • perfect for complex, highly connected data
  • 30. The property graph model ๏Core abstractions: •Nodes •Relationships between nodes •Properties on both ๏ Traversal framework • High performance queries on connected data sets name = “Jordi” age = 29 type = KNOWS time = 4 years type = car vendor = “Honda” model = “Civic”
  • 31. Good For • Highly connected data (social networks) • Recommendations (e-commerce) • Path Finding (how do I know you?) • A* (Least Cost path) • Data First Schema (bottom-up, but you still need to design)
  • 32. Ten Reasons for Choosing Neo4j • World’s Best and First Graph Database • Biggest and Most Active Graph Community on the Planet o 1,000,000+ downloads, adding 50,000 downloads per month o 20,000+ graph education registrants o 20,000+ Meetup members o 500+ Neo4j events per year o 100+ technology and service partners o 200 enterprise subscription customers, including 50+ of the Global 2000
  • 33. • Highly Performant Read and Write Scalability, Without Compromise • High Performance Thanks to Native Graph Storage & Processing • Easy to Learn • Easy to Use • Easier than Ever to Load Your Data into Neo4j • Whiteboard-friendly Data Modeling to Simplify the Development Cycle • Superb Value for Enterprise and Startup Projects
  • 35. // then traverse to find results start n=(people-index, name, “Andreas”) match (n)--()--(foaf) return foaf n
  • 36. Cypher // get node 0 start a=(0) return a // traverse from node 1 start a=(1) match (a)-->(b) return b // return friends of friends start a=(1) match (a)--()--(c) return c Pattern Matching Query Language (like SQL for graphs)
  • 37. Social data (customer: brand-name social network) name = “Mike” age = 29 disclosure = public name = “Charlie” last_name = “Runkle” name = “Dani” last_name = “California” age = 27 KNOWS name = “Hank” last_name = “Moody” age = 42 age = 3 days name = “Karen” KNOWS name = “Marcy Runkle”
  • 38. Spatial data (customer: large telecom company) name = “Omni Hotel” lat = 3492848 long = 283823423 length = 7 miles name = ... lat, long = ... name = “Swedland” lat = 23410349 long = 2342348852 ROAD name = “The Tavern” lat = 1295238237 long = 234823492 length = 3 miles name = ... ROAD name = ...
  • 39. Social AND spatial data name = “Omni Hotel” lat = 3492848 long = 283823423 weight = 10 name = “Pere” beer_qual = expert name = “Maria” age = 30 beer_qual = non- existant LIKES name = “The Tavern” lat = 1295238237 long = 234823492 length = 3 miles name = ... ROAD name = “Jordi”
  • 40. Query structure MATCH (n:Label)-[:REL]->(m:Label) WHERE n.prop < 42 WITH n, count(m) as cnt, collect(m.attr) as attrs WHERE cnt > 12 RETURN n.prop, extract(a2 in filter(a1 in attrs WHERE a1 =~ "...-.*") | substr(a2,4,size(a2)-1)] AS ids ORDER BY length(ids) DESC LIMIT 10
  • 41. MATCH describes the pattern MATCH (n:Label)-[:REL]->(m:Label) WHERE n.prop < 42 WITH n, count(m) as cnt, collect(m.attr) as attrs WHERE cnt > 12 RETURN n.prop, extract(a2 in filter(a1 in attrs WHERE a1 =~ "...-.*") | substr(a2,4,size(a2)-1)] AS ids ORDER BY length(ids) DESC SKIP 5 LIMIT 10
  • 42. WHERE filters the result set MATCH (n:Label)-[:REL]->(m:Label) WHERE n.prop < 42 WITH n, count(m) as cnt, collect(m.attr) as attrs WHERE cnt > 12 RETURN n.prop, extract(a2 in filter(a1 in attrs WHERE a1 =~ "...-.*") | substr(a2,4,size(a2)-1)] AS ids ORDER BY length(ids) DESC SKIP 5 LIMIT 10
  • 43. RETURN returns the result rows MATCH (n:Label)-[:REL]->(m:Label) WHERE n.prop < 42 WITH n, count(m) as cnt, collect(m.attr) as attrs WHERE cnt > 12 RETURN n.prop, extract(a2 in filter(a1 in attrs WHERE a1 =~ "...-.*") | substr(a2,4,size(a2)-1)] AS ids ORDER BY length(ids) DESC SKIP 5 LIMIT 10
  • 44. ORDER BY LIMIT SKIP sort and paginate MATCH (n:Label)-[:REL]->(m:Label) WHERE n.prop < 42 WITH n, count(m) as cnt, collect(m.attr) as attrs WHERE cnt > 12 RETURN n.prop, extract(a2 in filter(a1 in attrs WHERE a1 =~ "...-.*") | substr(a2,4,size(a2)-1)] AS ids ORDER BY length(ids) DESC SKIP 5 LIMIT 10
  • 45. WITH combines query parts like a pipe MATCH (n:Label)-[:REL]->(m:Label) WHERE n.prop < 42 WITH n, count(m) as cnt, collect(m.attr) as attrs WHERE cnt > 12 RETURN n.prop, extract(a2 in filter(a1 in attrs WHERE a1 =~ "...-.*") | substr(a2,4,size(a2)-1)] AS ids ORDER BY length(ids) DESC SKIP 5 LIMIT 10
  • 46. Collections powerful datastructure handlingMATCH (n:Label)-[:REL]->(m:Label) WHERE n.prop < 42 WITH n, count(m) as cnt, collect(m.attr) as attrs WHERE cnt > 12 RETURN n.prop, extract(a2 in filter(a1 in attrs WHERE a1 =~ "...-.*") | substr(a2,4,size(a2)-1)] AS ids ORDER BY length(ids) DESC LIMIT 10
  • 47. CREATE creates nodes, relationships and patterns CREATE - nodes, rels, structures CREATE (y:Year {year:2014}) FOREACH (m IN range(1,12) | CREATE (:Month {month:m})-[:IN]->(y) )
  • 48. MERGE matches or creates MERGE (y:Year {year:2014}) ON CREATE SET y.created = timestamp() FOREACH (m IN range(1,12) | MERGE (:Month {month:m})-[:IN]->(y) )
  • 49. SET, REMOVE update attributes and labels MATCH (year:Year) WHERE year.year % 4 = 0 OR year.year % 100 <> 0 AND year.year % 400 = 0 SET year:Leap WITH year MATCH (year)<-[:IN]-(feb:Month {month:2}) SET feb.days = 29 CREATE (feb)<-[:IN]-(:Day {day:29})
  • 52. Uses