SlideShare a Scribd company logo
Dgraph: Graph database for production environment
Tomasz Zdybał, Dgraph Labs
https://dgraph.io
Feb 08, 2017
Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 1 / 23
Overview
Overview
1 Introduction
2 Design
3 Highly debated decisions
4 GraphQL+- query language
5 Benchmarks
6 Q & A
Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 2 / 23
Introduction
Introduction
Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 3 / 23
Introduction
What is Dgraph?
Dgraph is an open source graph database built for web-scale production
environments written entirely in Go.
Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 4 / 23
Introduction
What is Dgraph?
Dgraph is an open source graph database built for web-scale production
environments written entirely in Go.
Goals
Sharded and Distributed
Automatic Replication
Consistent
Highly Available by design
Fault Tolerant
Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 4 / 23
Introduction
Why build it?
Graph technology is hidden, but everywhere.
Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 5 / 23
Introduction
Why build it?
Graph technology is hidden, but everywhere.
Any company doing anything smart is using graphs.
Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 5 / 23
Introduction
Why build it?
Graph technology is hidden, but everywhere.
Any company doing anything smart is using graphs.
Existing graphs have limited scalability (Neo4j), or graph layers on
top of other databases (Titan/DSE).
Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 5 / 23
Introduction
Why build it?
Graph technology is hidden, but everywhere.
Any company doing anything smart is using graphs.
Existing graphs have limited scalability (Neo4j), or graph layers on
top of other databases (Titan/DSE).
With no existing standard, companies have to build their own graph
systems (Facebook Tao, Google Knowledge Graph, Twitter FlockDB,
Dropbox, Pinterest, numerous others).
Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 5 / 23
Design
Design
Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 6 / 23
Design Concepts
NQuad :
Subject P r e d i c a t e Object .
<a l i c e > <f r i e n d > <bob> .
<a l i c e > <f r i e n d > <eve> .
<bob> <f r i e n d > <eve> .
Posting L i s t :
Subject P r e d i c a t e => ∗
<a l i c e > <f r i e n d > => [<bob>, <eve >]
Shard :
A l l p o s t i n g l i s t s f o r one p r e d i c a t e
<f r i e n d > => [< a l i c e f r i e n d >, <bob f r i e n d >]
Group :
Shards of d i f f e r e n t p r e d i c a t e s form a group
[ ∗ , P1 , ∗ ] , [ ∗ , P2 , ∗ ] , . . .
Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 7 / 23
Design Raft and Replication
Raft and Replication
Groups are replicated across servers.
Reads and writes go via Raft consensus algorithm.
Each server can handle many groups.
Ideally 1, 3 or 5 servers handling a group (odd number for consensus).
Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 8 / 23
Design Query Execution
Query Execution
Tree-like query structure.
Each branch is handled by one goroutine, allowing concurrent
execution of sibling branches.
Rough algorithm:
1 Retrieving results from network
2 Apply Filters, if any [one goroutine per child filter]
3 If required, do sort over network and run pagination
4 If only count required, do count and return
5 Process children, one child per goroutine recursively. Each child again
starts at 1.
Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 9 / 23
Highly debated decisions
Highly debated decisions
Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 10 / 23
Highly debated decisions Serialization
Protocol Buffers vs Flatbuffers
Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 11 / 23
Highly debated decisions Key-Value Store
RocksDB vs BoltDB
BoltDB acquires a global mutex lock around all reads and writes;
which skews it towards read-only system.
Going to Cgo for RocksDB is as fast as Bolt; but performs a whole lot
better under read-write workload.
Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 12 / 23
GraphQL+- query language
GraphQL+- query language
Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 13 / 23
GraphQL+- query language Introduction
GraphQL+-
used as primary language of communication
feature-rich variation of GraphQL
added support for graph operations
removed features not fitting well for a graph database
Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 14 / 23
GraphQL+- query language Introduction
GraphQL+-
used as primary language of communication
feature-rich variation of GraphQL
added support for graph operations
removed features not fitting well for a graph database
Why GraphQL as a base?
graph-like query syntax
schema validation
subgraph shaped response
Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 14 / 23
GraphQL+- query language Features
GraphQL+- features
pagination (using first, offset and after arguments)
aliasing of predicate names
counting number of entities
filtering (at root and predicate level)
various functions (comparison, term matching, geolocation)
sorting/ordering
variables
result normalization
Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 15 / 23
GraphQL+- query language Example
{
me( i d : m.06 pj8 ) {
name . en
d i r e c t o r . f i l m @ f i l t e r ( a l l o f (name . en , ” j o n e s i n d i a n a ” ) OR
a l l o f (name . en , ” j u r a s s i c park ” ) ) {
u i d
name . en
}
}
}
Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 16 / 23
Benchmarks
Benchmarks
Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 17 / 23
Benchmarks Cayley
Cayley
Cayley is a graph layer, not a graph database.
Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 18 / 23
Benchmarks Cayley
Cayley
Cayley is a graph layer, not a graph database.
Data handling is done outside of Cayley by other databases.
Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 18 / 23
Benchmarks Cayley
Cayley
Cayley is a graph layer, not a graph database.
Data handling is done outside of Cayley by other databases.
Results (Cayley with Bolt on Macbook)
Loading 21M RDFs – Dgraph is 9.7x faster
Queries (Gremlin) – Dgraph is 36.6x faster
Queries (MQL) – Dgraph is 5x faster
Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 18 / 23
Benchmarks Cayley
Cayley
Cayley is a graph layer, not a graph database.
Data handling is done outside of Cayley by other databases.
Results (Cayley with Bolt on Macbook)
Loading 21M RDFs – Dgraph is 9.7x faster
Queries (Gremlin) – Dgraph is 36.6x faster
Queries (MQL) – Dgraph is 5x faster
Dgraph would perform even better on distributed setup, when distributed joins
come into play.
Link to full benchmark code:
https://github.com/ankurayadav/graphdb-benchmarks
Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 18 / 23
Benchmarks Neo4j
Neo4j
Probably the most popular graph database
Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 19 / 23
Benchmarks Neo4j
Neo4j
Probably the most popular graph database
Results (on Thinkpad T460)
Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 19 / 23
Benchmarks Neo4j
Neo4j
Probably the most popular graph database
Results (on Thinkpad T460)
Loading 1.1M RDFs – Dgraph is 100x faster
Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 19 / 23
Benchmarks Neo4j
Neo4j
Probably the most popular graph database
Results (on Thinkpad T460)
Loading 1.1M RDFs – Dgraph is 100x faster
Queries – Dgraph is 3x-6x faster on a read-write workload and at
least as fast on read only
Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 19 / 23
Benchmarks Neo4j
Neo4j
Probably the most popular graph database
Results (on Thinkpad T460)
Loading 1.1M RDFs – Dgraph is 100x faster
Queries – Dgraph is 3x-6x faster on a read-write workload and at
least as fast on read only
Benchmark description: https://open.dgraph.io/post/benchmark-neo4j/
Link to full benchmark code:
https://github.com/dgraph-io/benchmarks/tree/master/data/neo4j
Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 19 / 23
Benchmarks Neo4j
Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 20 / 23
Benchmarks Neo4j
How Dgraph can load up data at least 100 times faster than Neo4j
(clickable link)
Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 21 / 23
Q & A
Q & A
Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 22 / 23
Q & A
Questions and Answers
Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 23 / 23

More Related Content

PPTX
Introduction to DGraph - A Graph Database
PPTX
GraphQL & DGraph with Go
ODP
DGraph: Introduction To Basics & Quick Start W/Ratel
PDF
Custom Pregel Algorithms in ArangoDB
PDF
Graph Analytics with ArangoDB
PPTX
Hacktoberfest 2020 - Intro to Knowledge Graphs
PDF
Machine Learning and GraphX
PDF
GraphFrames: Graph Queries in Spark SQL by Ankur Dave
Introduction to DGraph - A Graph Database
GraphQL & DGraph with Go
DGraph: Introduction To Basics & Quick Start W/Ratel
Custom Pregel Algorithms in ArangoDB
Graph Analytics with ArangoDB
Hacktoberfest 2020 - Intro to Knowledge Graphs
Machine Learning and GraphX
GraphFrames: Graph Queries in Spark SQL by Ankur Dave

What's hot (20)

PDF
An Introduction to Spark with Scala
ODP
Graphs are everywhere! Distributed graph computing with Spark GraphX
PDF
GraphX: Graph analytics for insights about developer communities
PDF
GraphX: Graph Analytics in Apache Spark (AMPCamp 5, 2014-11-20)
PDF
GraphFrames: Graph Queries In Spark SQL
PPTX
Pilot Project for HDF5 Metadata Structures for SWOT
PDF
Graph Analytics in Spark
PDF
GraphFrames: DataFrame-based graphs for Apache® Spark™
PDF
Regal - a Repository for Electronic Documents and Bibliographic Data
PDF
Transitioning from Traditional DW to Apache® Spark™ in Operating Room Predict...
PDF
Geospatial querying in Apache Marmotta - ApacheCon Big Data Europe 2015
PPTX
Apache Spark GraphX highlights.
PDF
Anatomy of Data Source API : A deep dive into Spark Data source API
PPTX
Utilizing HDF4 File Content Maps for the Cloud Computing
PDF
How To Visualize Graphs
PDF
From flat files to deconstructed database
PDF
Evolution of the Graph Schema
PPT
Giraph++: From "Think Like a Vertex" to "Think Like a Graph"
PPTX
SPD and KEA: HDF5 based file formats for Earth Observation
PPTX
Data Analytics using MATLAB and HDF5
An Introduction to Spark with Scala
Graphs are everywhere! Distributed graph computing with Spark GraphX
GraphX: Graph analytics for insights about developer communities
GraphX: Graph Analytics in Apache Spark (AMPCamp 5, 2014-11-20)
GraphFrames: Graph Queries In Spark SQL
Pilot Project for HDF5 Metadata Structures for SWOT
Graph Analytics in Spark
GraphFrames: DataFrame-based graphs for Apache® Spark™
Regal - a Repository for Electronic Documents and Bibliographic Data
Transitioning from Traditional DW to Apache® Spark™ in Operating Room Predict...
Geospatial querying in Apache Marmotta - ApacheCon Big Data Europe 2015
Apache Spark GraphX highlights.
Anatomy of Data Source API : A deep dive into Spark Data source API
Utilizing HDF4 File Content Maps for the Cloud Computing
How To Visualize Graphs
From flat files to deconstructed database
Evolution of the Graph Schema
Giraph++: From "Think Like a Vertex" to "Think Like a Graph"
SPD and KEA: HDF5 based file formats for Earth Observation
Data Analytics using MATLAB and HDF5
Ad

Similar to Dgraph: Graph database for production environment (20)

PDF
Ehtsham Elahi, Senior Research Engineer, Personalization Science and Engineer...
PDF
Introduction to Hadoop
PDF
Hadoop-Introduction
PPTX
HDF-EOS Data Product Developer's Guide
PPTX
Next generation analytics with yarn, spark and graph lab
PPTX
Analyzing Big data in R and Scala using Apache Spark 17-7-19
PPTX
Large-scale Recommendation Systems on Just a PC
PDF
ACM DBPL Keynote: The Graph Traversal Machine and Language
PDF
RAPIDS cuGraph – Accelerating all your Graph needs
PDF
Extended Property Graphs and Cypher on Gradoop
PPTX
Accumulo Summit 2015: Using D4M for rapid prototyping of analytics for Apache...
PPT
Hadoop trainting-in-hyderabad@kelly technologies
PDF
Graph Gurus Episode 1: Enterprise Graph
PPTX
CS267_Graph_Lab
PDF
Sparse matrix computations in MapReduce
PDF
RAPIDS – Open GPU-accelerated Data Science
PDF
How Graph Databases started the Multi Model revolution
PDF
aRangodb, un package per l'utilizzo di ArangoDB con R
PDF
Boston Spark Meetup event Slides Update
PDF
Non-Specialized File Format Extension
Ehtsham Elahi, Senior Research Engineer, Personalization Science and Engineer...
Introduction to Hadoop
Hadoop-Introduction
HDF-EOS Data Product Developer's Guide
Next generation analytics with yarn, spark and graph lab
Analyzing Big data in R and Scala using Apache Spark 17-7-19
Large-scale Recommendation Systems on Just a PC
ACM DBPL Keynote: The Graph Traversal Machine and Language
RAPIDS cuGraph – Accelerating all your Graph needs
Extended Property Graphs and Cypher on Gradoop
Accumulo Summit 2015: Using D4M for rapid prototyping of analytics for Apache...
Hadoop trainting-in-hyderabad@kelly technologies
Graph Gurus Episode 1: Enterprise Graph
CS267_Graph_Lab
Sparse matrix computations in MapReduce
RAPIDS – Open GPU-accelerated Data Science
How Graph Databases started the Multi Model revolution
aRangodb, un package per l'utilizzo di ArangoDB con R
Boston Spark Meetup event Slides Update
Non-Specialized File Format Extension
Ad

More from openCypher (20)

PDF
Learning Timed Automata with Cypher
PDF
Incremental View Maintenance for openCypher Queries
PDF
Formal semantics for Cypher queries and updates
PDF
Cypher.PL: an executable specification of Cypher semantics
PDF
Multiple Graphs: Updatable Views
PDF
Micro-Servicing Linked Data
PDF
Graph abstraction
PDF
From Cypher 9 to GQL: Conceptual overview of multiple named graphs and compos...
PDF
Cypher for Gremlin
PDF
Comparing PGQL, G-Core and Cypher
PDF
Multiple graphs in openCypher
PDF
Eighth openCypher Implementers Group Meeting: Status Update
PDF
Cypher for Gremlin
PDF
Supporting dates and times in Cypher
PDF
Seventh openCypher Implementers Group Meeting: Status Update
PDF
Academic research on graph processing: connecting recent findings to industri...
PDF
Property Graphs with Time
PDF
Cypher.PL: Executable Specification of Cypher written in Prolog
PDF
Use case: processing multiple graphs
PDF
openCypher Technology Compatibility Kit (TCK)
Learning Timed Automata with Cypher
Incremental View Maintenance for openCypher Queries
Formal semantics for Cypher queries and updates
Cypher.PL: an executable specification of Cypher semantics
Multiple Graphs: Updatable Views
Micro-Servicing Linked Data
Graph abstraction
From Cypher 9 to GQL: Conceptual overview of multiple named graphs and compos...
Cypher for Gremlin
Comparing PGQL, G-Core and Cypher
Multiple graphs in openCypher
Eighth openCypher Implementers Group Meeting: Status Update
Cypher for Gremlin
Supporting dates and times in Cypher
Seventh openCypher Implementers Group Meeting: Status Update
Academic research on graph processing: connecting recent findings to industri...
Property Graphs with Time
Cypher.PL: Executable Specification of Cypher written in Prolog
Use case: processing multiple graphs
openCypher Technology Compatibility Kit (TCK)

Recently uploaded (20)

PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Empathic Computing: Creating Shared Understanding
PDF
madgavkar20181017ppt McKinsey Presentation.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Sensors and Actuators in IoT Systems using pdf
PDF
Modernizing your data center with Dell and AMD
PDF
Advanced Soft Computing BINUS July 2025.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
AI And Its Effect On The Evolving IT Sector In Australia - Elevate
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
Review of recent advances in non-invasive hemoglobin estimation
NewMind AI Monthly Chronicles - July 2025
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Reach Out and Touch Someone: Haptics and Empathic Computing
Empathic Computing: Creating Shared Understanding
madgavkar20181017ppt McKinsey Presentation.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
MYSQL Presentation for SQL database connectivity
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Sensors and Actuators in IoT Systems using pdf
Modernizing your data center with Dell and AMD
Advanced Soft Computing BINUS July 2025.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
AI And Its Effect On The Evolving IT Sector In Australia - Elevate
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Diabetes mellitus diagnosis method based random forest with bat algorithm
20250228 LYD VKU AI Blended-Learning.pptx
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
Spectral efficient network and resource selection model in 5G networks
Dropbox Q2 2025 Financial Results & Investor Presentation

Dgraph: Graph database for production environment

  • 1. Dgraph: Graph database for production environment Tomasz Zdybał, Dgraph Labs https://dgraph.io Feb 08, 2017 Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 1 / 23
  • 2. Overview Overview 1 Introduction 2 Design 3 Highly debated decisions 4 GraphQL+- query language 5 Benchmarks 6 Q & A Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 2 / 23
  • 3. Introduction Introduction Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 3 / 23
  • 4. Introduction What is Dgraph? Dgraph is an open source graph database built for web-scale production environments written entirely in Go. Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 4 / 23
  • 5. Introduction What is Dgraph? Dgraph is an open source graph database built for web-scale production environments written entirely in Go. Goals Sharded and Distributed Automatic Replication Consistent Highly Available by design Fault Tolerant Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 4 / 23
  • 6. Introduction Why build it? Graph technology is hidden, but everywhere. Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 5 / 23
  • 7. Introduction Why build it? Graph technology is hidden, but everywhere. Any company doing anything smart is using graphs. Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 5 / 23
  • 8. Introduction Why build it? Graph technology is hidden, but everywhere. Any company doing anything smart is using graphs. Existing graphs have limited scalability (Neo4j), or graph layers on top of other databases (Titan/DSE). Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 5 / 23
  • 9. Introduction Why build it? Graph technology is hidden, but everywhere. Any company doing anything smart is using graphs. Existing graphs have limited scalability (Neo4j), or graph layers on top of other databases (Titan/DSE). With no existing standard, companies have to build their own graph systems (Facebook Tao, Google Knowledge Graph, Twitter FlockDB, Dropbox, Pinterest, numerous others). Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 5 / 23
  • 10. Design Design Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 6 / 23
  • 11. Design Concepts NQuad : Subject P r e d i c a t e Object . <a l i c e > <f r i e n d > <bob> . <a l i c e > <f r i e n d > <eve> . <bob> <f r i e n d > <eve> . Posting L i s t : Subject P r e d i c a t e => ∗ <a l i c e > <f r i e n d > => [<bob>, <eve >] Shard : A l l p o s t i n g l i s t s f o r one p r e d i c a t e <f r i e n d > => [< a l i c e f r i e n d >, <bob f r i e n d >] Group : Shards of d i f f e r e n t p r e d i c a t e s form a group [ ∗ , P1 , ∗ ] , [ ∗ , P2 , ∗ ] , . . . Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 7 / 23
  • 12. Design Raft and Replication Raft and Replication Groups are replicated across servers. Reads and writes go via Raft consensus algorithm. Each server can handle many groups. Ideally 1, 3 or 5 servers handling a group (odd number for consensus). Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 8 / 23
  • 13. Design Query Execution Query Execution Tree-like query structure. Each branch is handled by one goroutine, allowing concurrent execution of sibling branches. Rough algorithm: 1 Retrieving results from network 2 Apply Filters, if any [one goroutine per child filter] 3 If required, do sort over network and run pagination 4 If only count required, do count and return 5 Process children, one child per goroutine recursively. Each child again starts at 1. Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 9 / 23
  • 14. Highly debated decisions Highly debated decisions Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 10 / 23
  • 15. Highly debated decisions Serialization Protocol Buffers vs Flatbuffers Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 11 / 23
  • 16. Highly debated decisions Key-Value Store RocksDB vs BoltDB BoltDB acquires a global mutex lock around all reads and writes; which skews it towards read-only system. Going to Cgo for RocksDB is as fast as Bolt; but performs a whole lot better under read-write workload. Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 12 / 23
  • 17. GraphQL+- query language GraphQL+- query language Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 13 / 23
  • 18. GraphQL+- query language Introduction GraphQL+- used as primary language of communication feature-rich variation of GraphQL added support for graph operations removed features not fitting well for a graph database Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 14 / 23
  • 19. GraphQL+- query language Introduction GraphQL+- used as primary language of communication feature-rich variation of GraphQL added support for graph operations removed features not fitting well for a graph database Why GraphQL as a base? graph-like query syntax schema validation subgraph shaped response Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 14 / 23
  • 20. GraphQL+- query language Features GraphQL+- features pagination (using first, offset and after arguments) aliasing of predicate names counting number of entities filtering (at root and predicate level) various functions (comparison, term matching, geolocation) sorting/ordering variables result normalization Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 15 / 23
  • 21. GraphQL+- query language Example { me( i d : m.06 pj8 ) { name . en d i r e c t o r . f i l m @ f i l t e r ( a l l o f (name . en , ” j o n e s i n d i a n a ” ) OR a l l o f (name . en , ” j u r a s s i c park ” ) ) { u i d name . en } } } Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 16 / 23
  • 22. Benchmarks Benchmarks Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 17 / 23
  • 23. Benchmarks Cayley Cayley Cayley is a graph layer, not a graph database. Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 18 / 23
  • 24. Benchmarks Cayley Cayley Cayley is a graph layer, not a graph database. Data handling is done outside of Cayley by other databases. Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 18 / 23
  • 25. Benchmarks Cayley Cayley Cayley is a graph layer, not a graph database. Data handling is done outside of Cayley by other databases. Results (Cayley with Bolt on Macbook) Loading 21M RDFs – Dgraph is 9.7x faster Queries (Gremlin) – Dgraph is 36.6x faster Queries (MQL) – Dgraph is 5x faster Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 18 / 23
  • 26. Benchmarks Cayley Cayley Cayley is a graph layer, not a graph database. Data handling is done outside of Cayley by other databases. Results (Cayley with Bolt on Macbook) Loading 21M RDFs – Dgraph is 9.7x faster Queries (Gremlin) – Dgraph is 36.6x faster Queries (MQL) – Dgraph is 5x faster Dgraph would perform even better on distributed setup, when distributed joins come into play. Link to full benchmark code: https://github.com/ankurayadav/graphdb-benchmarks Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 18 / 23
  • 27. Benchmarks Neo4j Neo4j Probably the most popular graph database Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 19 / 23
  • 28. Benchmarks Neo4j Neo4j Probably the most popular graph database Results (on Thinkpad T460) Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 19 / 23
  • 29. Benchmarks Neo4j Neo4j Probably the most popular graph database Results (on Thinkpad T460) Loading 1.1M RDFs – Dgraph is 100x faster Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 19 / 23
  • 30. Benchmarks Neo4j Neo4j Probably the most popular graph database Results (on Thinkpad T460) Loading 1.1M RDFs – Dgraph is 100x faster Queries – Dgraph is 3x-6x faster on a read-write workload and at least as fast on read only Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 19 / 23
  • 31. Benchmarks Neo4j Neo4j Probably the most popular graph database Results (on Thinkpad T460) Loading 1.1M RDFs – Dgraph is 100x faster Queries – Dgraph is 3x-6x faster on a read-write workload and at least as fast on read only Benchmark description: https://open.dgraph.io/post/benchmark-neo4j/ Link to full benchmark code: https://github.com/dgraph-io/benchmarks/tree/master/data/neo4j Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 19 / 23
  • 32. Benchmarks Neo4j Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 20 / 23
  • 33. Benchmarks Neo4j How Dgraph can load up data at least 100 times faster than Neo4j (clickable link) Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 21 / 23
  • 34. Q & A Q & A Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 22 / 23
  • 35. Q & A Questions and Answers Tomasz Zdybał, Dgraph Labs Dgraph: Graph database for production environment 23 / 23