Neo4j and graph databases Presented By: Stephanie McIntyre Graph - - PowerPoint PPT Presentation

neo4j
SMART_READER_LITE
LIVE PREVIEW

Neo4j and graph databases Presented By: Stephanie McIntyre Graph - - PowerPoint PPT Presentation

Neo4j and graph databases Presented By: Stephanie McIntyre Graph Databases: The Database Model The Database Model determines the logical structure . Graph databases (GDB) have the following characteristics: Data & Schema are represented by


slide-1
SLIDE 1

Neo4j

Presented By: Stephanie McIntyre

and graph databases

slide-2
SLIDE 2

Graph Databases: The Database Model

The Database Model determines the logical structure. Graph databases (GDB) have the following characteristics:

  • Data & Schema are represented by a graph.
  • Manipulation of data is expressed by graph transformations.

The driving force of this model is the focus on the relationships between entities.

slide-3
SLIDE 3

Graph Databases: Data & Schema

A GDB is a directed, labelled, attributed multigraph.

  • Nodes: connected entities

○ defined by unique id

  • Edges: binary relations

○ direction, start node, end node

  • Properties: descriptive information

  • n nodes, sometimes on edges

Nodes & Edges are tagged with labels.

slide-4
SLIDE 4

Graph Databases: Data & Schema

  • No global adjacency index.

(exception: Neo4j for starting points).

  • Each node and edge stores a mini-index of all of the

connected objects.

  • No NULLs
  • GDBs have an ad-hoc schema that is easily mutable.

○ Neo4j supports schema-less

slide-5
SLIDE 5

Graph Databases: Going for a Walk

Query processing makes use of graph-based algorithms and retrieval of information requires graph traversal, aka “walking”. When retrieving information, it only looks at the objects directly connected to the node. Graph databases are typically better than relational databases at handling recursion.

slide-6
SLIDE 6

Graph Databases: Example

Ahmed

CS848

databases

UW

university

Yue

David Toman

Steph

age: 30

Bharath Photo Arts friends_with friends_with friends_with friends_with teaches s t u d e n t _ a t C S _ g r a d student_at CS_grad student_at CS_grad s t u d e n t _ a t C S _ g r a d professor_at CS_dept employs hired: 1998 has_advisor e n r

  • l

l e d _ i n s p r i n g 2 1 8 enrolled_in spring 2018 e n r

  • l

l e d _ i n s p r i n g 2 1 8 enrolled_in spring 2018 c

  • u

r s e _

  • f

f e r i n g artist hobbyist artist amateur

slide-7
SLIDE 7

Graph vs Relational Databases

Some differences...

Graph Databases (Neo4j) Relational Databases Mathematical Model Property Graphs N-ary Predicates Relationships Record Level Table Level Schema Schema-less or on labels Schema Based Query Processing Localized Indexes, Keys Costly Queries Find all Many-to-Many Table Joins Data Manipulation Easily Mutable Table Alterations Integrity Constraints …. ^-^

slide-8
SLIDE 8

Neo4j’s Integrity Constraints

Inherent Constraints: Node IDs are unique and edges are composed of labels and the nodes where the edge occurs. Node Property Uniqueness: given property is unique for nodes. Relationship Property Existence: relationships with a given label have a given property. Node Keys: existence of given properties and uniqueness of the combination thereof for a given label.