SlideShare a Scribd company logo
1 of 21
GRAPH DATABASE OF
NOSQL
Presented By
M.Jeya Varthini-
M.sc(CS)

DESIGING FOR GRAPH DATABASE
 Getting Started with Graph Design
 Querying a Graph
 Tips and Traps Graph Database Design
Graph Database

 The NoSQL ('not only SQL') graph database
is a technology for data management designed
to handle very large sets of structured, semi-
structured or unstructured data.
 It helps organizations access, integrate and
analyze data from various sources, thus helping
them with their big data and social media
analytics.
GRAPH DATABASE

Some examples of Graph Databases software are
Neo4j, Oracle NoSQL DB, Graph base etc.
Out of which Neo4j is the most popular one.
In traditional databases, the relationships between
data is not established. But in the case of Graph
Database, the relationships between data are
prioritized.
Which graphs are NoSQL databases?

Instagram , Twitter, Facebook, Amazon,
and, practically, all applications, which
must rapidly query information scattered
across an exponentially-growing and
highly-dynamic network of data, are
already taking advantage of Graph
Databases.
What is graph database examples?

Difference between NoSQL and graph
database
This requires joining aggregates at the application
level, which quickly becomes prohibitively
expensive.
Other NoSQL databases lack relationships.
Graph databases, on the other hand, handle
fine-grained networks of information,
providing any perspective on your data that
fits your use case.

The advantage of a graph database
Some advantages of graph databases
include:
 The structures are agile and flexible.
The representation of relationships between
entities is explicit.
 Queries output real-time results.

A common characteristic of NoSQL
databases is the way you approach design,
which is by asking what kinds of queries or
analysis you will perform on the data.
Getting Started with Graph Design

 Graph databases are well suited to problem domains that
are easily described in terms of entities and relations
between those entities.
 Entities can be virtually anything, from proteins to planets.
 Of course, other NoSQL databases and relational
databases are well suited to modeling entities, too.
Getting Started with Graph Design

Applications using graph databases can take
advantage of the vertex edge data model to
implement efficient query and analysis
capabilities.
At the same time, graph operations that run in
reasonable time with modest-size.
Tips and Traps of Graph Database Design

 Graphs may take too long to complete
when the graph grows larger.
This section discusses several techniques
that can be used to optimize performance
when working with graphs.
Tips and Traps of Graph Database
Design

Some graph databases provide for indexes on
nodes. Neo4j, for example, provides a CREATE
INDEX command that allows developers to
specify properties to index.
The Cypher query processor automatically uses
indexes, when they are available, to improve the
query performance ofWHERE and IN operations.
Use Indexes to Improve Retrieval Time

The motto of the Perl programing language is
“There is more than one way to do it.” The
same statement applies to querying graphs.
The Cypher query language provides a
declarative, SQL-like language for building
queries.
Cypher is used with the Neo4j graph database
(neo4j.com).
Querying a Graph

Alternatively, developers can use Gremlin, a
graph traversal language that works with a
number of different graph databases.
The goal in this section is not to teach you the
details of these query languages, but to give you a
flavor for how each works and show examples of
how each language is used.
Querying a Graph

 Before you can query a graph, you must create one.
Cypher statements to create vertices for the preceding
 NoSQL social network include
 CREATE (rober t: Developer { name: 'Robert Smith' })
 CREATE (andrea : Developer { name: 'Andrea Wilson' })
 CREATE (charles : Developer { name: 'Charles Vita' })
Cypher: Declarative Querying

These three statements create three vertices. The text
robert: Developer creates a developer vertex with a
label of robert.
The text { name: 'Robert Smith' } adds a property to
the node to store the name of the developer.
Edges are added with create statements as well. For
example:
CREATE (robert)-[FOLLOWS]->(andrea)
CREATE (andrea)-[FOLLOWS]->(charles)
Cypher: Declarative Querying

 To query nodes in Cypher, use the MATCH command,
which returns all developers in the social network:
 MATCH (developer:DEVELOPER)
RETURN (developer)
 A comparable query in SQL is
 SELECT *
FROM developer
 SQL is a declarative language designed to work with
tables that consist of rows and columns.
Cypher: Declarative Querying

 Cypher is a declarative language designed to work with
graphs that consist of vertices and edges, so it is not
surprising that there are ways to query based on both. For
example, the following returns all developer nodes linked
to Robert Smith:
 MATCH (robert:Developer {name:'Robert
Smith'})--(developer:DEVELOPER)
RETURN developers
 The MATCH operation starts with the node robert and
searches all edges that lead to vertices of type
DEVELOPER and returns those that it finds.
Cypher: Declarative Querying

 Cypher is a rich language with support for many graph
operations. It also has clauses found in SQL, such as the
following:
• WHERE
• ORDER BY
• LIMIT
• UNION
• COUNT
• DISTINCT
• SUM
• AVG
Cypher: Declarative Querying

Traverse means to travel across or through.
Graph traversal is the process of logically
moving from one vertex to another over an
edge.
 Instead of querying by specifying criteria
for selecting vertices, as in Cypher, you
specify vertices and rules for traversing
them.
Gremlin: Query by Graph Traversal

!

More Related Content

Similar to Graph Databases and NoSQL

Big data analysis using spark r published
Big data analysis using spark r publishedBig data analysis using spark r published
Big data analysis using spark r publishedDipendra Kusi
 
Fishing Graphs in a Hadoop Data Lake
Fishing Graphs in a Hadoop Data LakeFishing Graphs in a Hadoop Data Lake
Fishing Graphs in a Hadoop Data LakeArangoDB Database
 
Why no sql_ibm_cloudant
Why no sql_ibm_cloudantWhy no sql_ibm_cloudant
Why no sql_ibm_cloudantPeter Tutty
 
Global AI Bootcamp Madrid - Azure Databricks
Global AI Bootcamp Madrid - Azure DatabricksGlobal AI Bootcamp Madrid - Azure Databricks
Global AI Bootcamp Madrid - Azure DatabricksAlberto Diaz Martin
 
Sparkr sigmod
Sparkr sigmodSparkr sigmod
Sparkr sigmodwaqasm86
 
Bringing the Power and Familiarity of .NET, C# and F# to Big Data Processing ...
Bringing the Power and Familiarity of .NET, C# and F# to Big Data Processing ...Bringing the Power and Familiarity of .NET, C# and F# to Big Data Processing ...
Bringing the Power and Familiarity of .NET, C# and F# to Big Data Processing ...Michael Rys
 
Building data pipelines for modern data warehouse with Apache® Spark™ and .NE...
Building data pipelines for modern data warehouse with Apache® Spark™ and .NE...Building data pipelines for modern data warehouse with Apache® Spark™ and .NE...
Building data pipelines for modern data warehouse with Apache® Spark™ and .NE...Michael Rys
 
GraphTech Ecosystem - part 1: Graph Databases
GraphTech Ecosystem - part 1: Graph DatabasesGraphTech Ecosystem - part 1: Graph Databases
GraphTech Ecosystem - part 1: Graph DatabasesLinkurious
 
Introduction to Azure Databricks
Introduction to Azure DatabricksIntroduction to Azure Databricks
Introduction to Azure DatabricksJames Serra
 
Composable Parallel Processing in Apache Spark and Weld
Composable Parallel Processing in Apache Spark and WeldComposable Parallel Processing in Apache Spark and Weld
Composable Parallel Processing in Apache Spark and WeldDatabricks
 
Database Integrated Analytics using R InitialExperiences wi
Database Integrated Analytics using R InitialExperiences wiDatabase Integrated Analytics using R InitialExperiences wi
Database Integrated Analytics using R InitialExperiences wiOllieShoresna
 
Vital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and Spark
Vital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and SparkVital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and Spark
Vital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and SparkVital.AI
 
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
 
.NET per la Data Science e oltre
.NET per la Data Science e oltre.NET per la Data Science e oltre
.NET per la Data Science e oltreMarco Parenzan
 

Similar to Graph Databases and NoSQL (20)

Big data analysis using spark r published
Big data analysis using spark r publishedBig data analysis using spark r published
Big data analysis using spark r published
 
Ruby on Rails
Ruby on RailsRuby on Rails
Ruby on Rails
 
Fishing Graphs in a Hadoop Data Lake
Fishing Graphs in a Hadoop Data LakeFishing Graphs in a Hadoop Data Lake
Fishing Graphs in a Hadoop Data Lake
 
Why no sql_ibm_cloudant
Why no sql_ibm_cloudantWhy no sql_ibm_cloudant
Why no sql_ibm_cloudant
 
Global AI Bootcamp Madrid - Azure Databricks
Global AI Bootcamp Madrid - Azure DatabricksGlobal AI Bootcamp Madrid - Azure Databricks
Global AI Bootcamp Madrid - Azure Databricks
 
Sparkr sigmod
Sparkr sigmodSparkr sigmod
Sparkr sigmod
 
Erciyes university
Erciyes universityErciyes university
Erciyes university
 
Bringing the Power and Familiarity of .NET, C# and F# to Big Data Processing ...
Bringing the Power and Familiarity of .NET, C# and F# to Big Data Processing ...Bringing the Power and Familiarity of .NET, C# and F# to Big Data Processing ...
Bringing the Power and Familiarity of .NET, C# and F# to Big Data Processing ...
 
Building data pipelines for modern data warehouse with Apache® Spark™ and .NE...
Building data pipelines for modern data warehouse with Apache® Spark™ and .NE...Building data pipelines for modern data warehouse with Apache® Spark™ and .NE...
Building data pipelines for modern data warehouse with Apache® Spark™ and .NE...
 
Selecting best NoSQL
Selecting best NoSQL Selecting best NoSQL
Selecting best NoSQL
 
GraphDB
GraphDBGraphDB
GraphDB
 
GraphTech Ecosystem - part 1: Graph Databases
GraphTech Ecosystem - part 1: Graph DatabasesGraphTech Ecosystem - part 1: Graph Databases
GraphTech Ecosystem - part 1: Graph Databases
 
Introduction to Azure Databricks
Introduction to Azure DatabricksIntroduction to Azure Databricks
Introduction to Azure Databricks
 
Composable Parallel Processing in Apache Spark and Weld
Composable Parallel Processing in Apache Spark and WeldComposable Parallel Processing in Apache Spark and Weld
Composable Parallel Processing in Apache Spark and Weld
 
Database Integrated Analytics using R InitialExperiences wi
Database Integrated Analytics using R InitialExperiences wiDatabase Integrated Analytics using R InitialExperiences wi
Database Integrated Analytics using R InitialExperiences wi
 
Vital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and Spark
Vital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and SparkVital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and Spark
Vital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and Spark
 
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
 
.NET per la Data Science e oltre
.NET per la Data Science e oltre.NET per la Data Science e oltre
.NET per la Data Science e oltre
 
r4
r4r4
r4
 

Recently uploaded

EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 

Recently uploaded (20)

EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 

Graph Databases and NoSQL

  • 1. GRAPH DATABASE OF NOSQL Presented By M.Jeya Varthini- M.sc(CS)
  • 2.  DESIGING FOR GRAPH DATABASE  Getting Started with Graph Design  Querying a Graph  Tips and Traps Graph Database Design Graph Database
  • 3.   The NoSQL ('not only SQL') graph database is a technology for data management designed to handle very large sets of structured, semi- structured or unstructured data.  It helps organizations access, integrate and analyze data from various sources, thus helping them with their big data and social media analytics. GRAPH DATABASE
  • 4.  Some examples of Graph Databases software are Neo4j, Oracle NoSQL DB, Graph base etc. Out of which Neo4j is the most popular one. In traditional databases, the relationships between data is not established. But in the case of Graph Database, the relationships between data are prioritized. Which graphs are NoSQL databases?
  • 5.  Instagram , Twitter, Facebook, Amazon, and, practically, all applications, which must rapidly query information scattered across an exponentially-growing and highly-dynamic network of data, are already taking advantage of Graph Databases. What is graph database examples?
  • 6.  Difference between NoSQL and graph database This requires joining aggregates at the application level, which quickly becomes prohibitively expensive. Other NoSQL databases lack relationships. Graph databases, on the other hand, handle fine-grained networks of information, providing any perspective on your data that fits your use case.
  • 7.  The advantage of a graph database Some advantages of graph databases include:  The structures are agile and flexible. The representation of relationships between entities is explicit.  Queries output real-time results.
  • 8.  A common characteristic of NoSQL databases is the way you approach design, which is by asking what kinds of queries or analysis you will perform on the data. Getting Started with Graph Design
  • 9.   Graph databases are well suited to problem domains that are easily described in terms of entities and relations between those entities.  Entities can be virtually anything, from proteins to planets.  Of course, other NoSQL databases and relational databases are well suited to modeling entities, too. Getting Started with Graph Design
  • 10.  Applications using graph databases can take advantage of the vertex edge data model to implement efficient query and analysis capabilities. At the same time, graph operations that run in reasonable time with modest-size. Tips and Traps of Graph Database Design
  • 11.   Graphs may take too long to complete when the graph grows larger. This section discusses several techniques that can be used to optimize performance when working with graphs. Tips and Traps of Graph Database Design
  • 12.  Some graph databases provide for indexes on nodes. Neo4j, for example, provides a CREATE INDEX command that allows developers to specify properties to index. The Cypher query processor automatically uses indexes, when they are available, to improve the query performance ofWHERE and IN operations. Use Indexes to Improve Retrieval Time
  • 13.  The motto of the Perl programing language is “There is more than one way to do it.” The same statement applies to querying graphs. The Cypher query language provides a declarative, SQL-like language for building queries. Cypher is used with the Neo4j graph database (neo4j.com). Querying a Graph
  • 14.  Alternatively, developers can use Gremlin, a graph traversal language that works with a number of different graph databases. The goal in this section is not to teach you the details of these query languages, but to give you a flavor for how each works and show examples of how each language is used. Querying a Graph
  • 15.   Before you can query a graph, you must create one. Cypher statements to create vertices for the preceding  NoSQL social network include  CREATE (rober t: Developer { name: 'Robert Smith' })  CREATE (andrea : Developer { name: 'Andrea Wilson' })  CREATE (charles : Developer { name: 'Charles Vita' }) Cypher: Declarative Querying
  • 16.  These three statements create three vertices. The text robert: Developer creates a developer vertex with a label of robert. The text { name: 'Robert Smith' } adds a property to the node to store the name of the developer. Edges are added with create statements as well. For example: CREATE (robert)-[FOLLOWS]->(andrea) CREATE (andrea)-[FOLLOWS]->(charles) Cypher: Declarative Querying
  • 17.   To query nodes in Cypher, use the MATCH command, which returns all developers in the social network:  MATCH (developer:DEVELOPER) RETURN (developer)  A comparable query in SQL is  SELECT * FROM developer  SQL is a declarative language designed to work with tables that consist of rows and columns. Cypher: Declarative Querying
  • 18.   Cypher is a declarative language designed to work with graphs that consist of vertices and edges, so it is not surprising that there are ways to query based on both. For example, the following returns all developer nodes linked to Robert Smith:  MATCH (robert:Developer {name:'Robert Smith'})--(developer:DEVELOPER) RETURN developers  The MATCH operation starts with the node robert and searches all edges that lead to vertices of type DEVELOPER and returns those that it finds. Cypher: Declarative Querying
  • 19.   Cypher is a rich language with support for many graph operations. It also has clauses found in SQL, such as the following: • WHERE • ORDER BY • LIMIT • UNION • COUNT • DISTINCT • SUM • AVG Cypher: Declarative Querying
  • 20.  Traverse means to travel across or through. Graph traversal is the process of logically moving from one vertex to another over an edge.  Instead of querying by specifying criteria for selecting vertices, as in Cypher, you specify vertices and rules for traversing them. Gremlin: Query by Graph Traversal
  • 21.  !