RedisGraph is a Redis module that enables enterprises to process any kind of connected data much faster than with traditional relational or existing graph databases. RedisGraph implements a unique data storage and processing solution (with sparse-adjacency matrices and GraphBLAS) to deliver the fastest and most efficient way to store, manage, and process connected data in graphs. With RedisGraph, you can process complex transactions 10 - 600 times faster than with traditional graph solutions while using 50 - 60% less memory resources than other graph databases!
Follow this link to register and subscribe to Redis Enterprise Cloud
Follow this link to know how to connect to a database
In the following steps, we will use some basic RediGraph commands to insert data into a graph and then query the graph. You can run them from the Redis command-line interface (redis-cli) or use the CLI available in RedisInsight. (See part 2 of this tutorial to learn more about using the RedisInsight CLI.)
To interact with RedisGraph you will typically use the GRAPH.QUERY command and execute Cypher queries. Let’s start to insert some actors into the graph:movies graph name, which is automatically created using this command:
This single query creates three actors, along with their names and unique IDs.
This single query creates a movie with a title, the release year, and an ID.
The core of a graph is the relationships between the nodes, allowing the applications to navigate and query them. Let’s create a relationship between the actors and the movies:
This command created a new relation indicating that the actor Mark Hamill acted in Star Wars: Episode V as Luke Skywalker.
Let’s repeat this process for the other actors:
You can also do all of this in a single query, for example:
Now that you have data in your graph, you’re ready to ask some questions, such as:
If you are using RedisInsight, you can visualize and navigate into the nodes and relationships graphically. Click on the RedisGraph menu entry on the left and enter the query:
Click on the Execute button, and double click on the actors to follow the relationships You should see a graph like this one:
- Learn more about RedisGraph in the Quickstart tutorial.