RedisGraph is a graph database built on Redis. Technically, it is a Redis module that extends graph database capabilities, including the property graph data model and graph query processing. RedisGraph exposes Cypher as its query language.[05][06][03]
- Website
- https://redisgraph.io[01]
- Source Code
- https://github.com/RedisGraph/RedisGraph[02]
- Developer
- Country of Origin
- US
- Start Year
- 2018 [25]
- Project Types
- Commercial, Open Source
- Written in
- C
- Supported Languages
- C
- Embeds / Uses
- Redis
- Operating System
- Linux
- License
- Server Side Public License
Graphs in RedisGraph are represented as sparse adjacency matrices. RedisGraph uses SuiteSparse, a package conforming GraphBLAS, a community-led project defining a linear algebraic interface for implementing graph algorithms, to represent sparse matrices and implements some physical query operators, such as Conditional Traverse.
RedisGraph is a graph database built on Redis. Technically, it is a Redis module that extends graph database capabilities, including the property graph data model and graph query processing. RedisGraph exposes Cypher as its query language.
Graphs in RedisGraph are represented as sparse adjacency matrices. RedisGraph uses SuiteSparse, a package conforming GraphBLAS, a community-led project defining a linear algebraic interface for implementing graph algorithms, to represent sparse matrices and implements some physical query operators, such as Conditional Traverse.[05][06][03]
History[07][08][09][10][11][12][13]
RedisGraph was created in 2018. One of the first official presentations by Redis Labs was published on YouTube in the same year.
RedisGraph v.1.0, the earliest version on the website, was published in November 2018. Parallely, RedisGraph also released their benchmarking result on their system. Later, RedisGraph updated its benchmarking result according to TigerGraph's requests.
RedisGraph v.2.0 was released in January 2020 (2 years later) with a full-text search, more Cypher language coverages, and performance improvement. The performance improvement and Cypher coverages were described in their blog.
Checkpoints[02][14]
According to their source code, RedisGraph does not provide additional checkpointing/snapshotting methods over the original Redis. Please refer to Redis for more details.
Compression[02][15][16][17][03]
Graphs in RedisGraph can be stored in sparse representations supported by GraphBLAS.
According to the GraphBLAS v.2.0.0's document, it supports Compressed Sparse Row (CSR), Compressed Sparse Column (CSC), and Coordinate List (COO) to compress matrices. The key idea of all the sparse representations is to suppress zero/undefined values in matrices by storing only indices of non-zero elements.
Otherwise, there is no specific compression scheme for properties and attributes from both RedisGraph (according to their source code) and its original system, Redis.
Data Model[18][03]
RedisGraph supports the property graph data model. Specifically, the data model defines nodes and edges. Nodes can have multiple labels, and edges can have a relationship type. Every node and edge can have multiple properties (i.e., attributes).
Foreign Keys[02]
According to their source code, RedisGraph does not support any foreign key constraints.
Indexes[19][20]
RedisGraph provides maintaining full-text indexes for querying nodes or edges by texts.
Specifically, RedisGraph uses RediSearch, which is an open-source Redis module. RediSearch uses Trie (Prefix Tree) data structures.
Joins[21]
RedisGraph provides a physical operator, Value Hash Join, which is used to join the records (i.e., tuples) from two child operators.
Although the name sounds like a hash join operator, the actual implementation is more similar to a sort-merge join. Their join operator starts with creating an array of the left operator's records. The array of the left operator's records will be sorted. The operator will iteratively probe the sorted array with the records from the right operator using a binary search algorithm.
Logging[22]
RedisGraph does not implement any additional logging mechanism. Please refer to AOF, a Redis logging mechanism, in Redis instead.
Query Execution[23]
Based on their implementation, RedisGraph uses the tuple-at-a-time model to process queries.
Graph-related operators are mainly implemented with GraphBLAS:SuiteSparse, a linear algebra package for implementing graph algorithms based on GraphBLAS. For example, the Conditional Traverse operator contains a breadth-first search traversal algorithm. The breadth-first search traversal algorithm uses matrix-matrix multiplication from GraphBLAS:SuiteSparse.
Some operators allow tuples to be batched before executing the operators' logic; for instance, the Conditional Traverse operator allows tuples to be batched before calling matrix-matrix multiplication.
Stored Procedures[24]
RedisGraph allows users to provide their stored procedures written in C. Each stored procedure must be provided and registered before compiling the RedisGraph module.
The valid stored procedure must contain a stored procedure name, a number of input arguments, an output specification (i.e., output data types, output field names), and three main routines. The three main routines include Invoke, Step, and Free. Invoke will be called first after the stored procedure is called. Then, Step will be called multiple times to produce a result tuple per Step call. Finally, Free will be called to clean up allocated memory. Users may store the state of each procedure call using the private_data pointer shared across these routines.
Citations
25 sources- https://redisgraph.io redisgraph.io
- GitHub - RedisGraph/RedisGraph: A graph database as a Redis module · GitHub github.com
- https://redis.io/docs/latest/stack/graph redis.io
- https://twitter.com/Redisinc twitter.com
- suitesparse : a suite of sparse matrix software tamu.edu
- https://redis.io/resources/modules/ redis.io
- Redis Graph with Roi Lipman - Redis Labs - YouTube youtube.com
- Benchmarking RedisGraph 1.0 | Redis redis.io
- Benchmarking RedisGraph 1.0: Update | Redis redis.io
- https://www.tigergraph.com/blog/benchmarking-redisgraph tigergraph.com
- RedisGraph 2.0 Boosts Performance Up to 6x | Redis redis.io
- RedisGraph 1.0 release notes | Docs redis.io
- RedisGraph 2.0 release notes | Docs redis.io
- Redis persistence | Docs redis.io
- https://graphblas.org/docs/GraphBLAS_API_C_v2.0.0.pdf graphblas.org
- The GraphBLAS | Welcome to the GraphBLAS Forum graphblas.org
- Sparse matrix - Wikipedia wikipedia.org
- https://ceur-ws.org/Vol-2100/paper26.pdf ceur-ws.org
- Search and query | Docs redis.io
- GitHub - RediSearch/RediSearch: A query and indexing engine for Redis, providing secondary indexing, full-text search, vector similarity search and aggregations. · GitHub github.com
- RedisGraph/src/execution_plan/ops/op_value_hash_join.c at master · RedisGraph/RedisGraph · GitHub github.com
- Redis persistence | Docs redis.io
- RedisGraph/src/execution_plan/execution_plan.c at master · RedisGraph/RedisGraph · GitHub github.com
- RedisGraph/src/procedures at master · RedisGraph/RedisGraph · GitHub github.com
- Insertion time should not be effected by graph size github.com