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

!

GraphDatabase.pptx

  • 1.
    GRAPH DATABASE OF NOSQL PresentedBy M.Jeya Varthini- M.sc(CS)
  • 2.
     DESIGING FOR GRAPHDATABASE  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 ofGraph 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 NoSQLand 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 ofa 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 characteristicof 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 databasesare 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 graphdatabases 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 maytake 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 databasesprovide 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 ofthe 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 canuse 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 youcan 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 statementscreate 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 querynodes 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 isa 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 isa 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 totravel 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.