How to Create a Data Graph using Visual Builder Beta

Create a data graph by connecting a warehouse, defining entity and event models, and configuring relationships between them.
Available Plans
  • growth
  • enterprise

This guide lists the steps to create a Data Graph in the RudderStack dashboard using the visual builder.

To create a data graph as YAML using Rudder CLI, see the Data Graph YAML reference.

Overview

Creating a data graph in RudderStack via the visual builder involves:

  1. Connecting a warehouse account — this acts as the source for the data graph
  2. Defining entity models, and event models
  3. Configuring relationships between the entities and events

Video walkthrough

Prerequisites

Your data graph is built on top of your warehouse data. Hence, you need a connected warehouse account before you can start building your data graph.

The steps to configure a warehouse connection are as follows:

1: Connect the warehouse account

  1. Navigate to Activate > Data Graph in the RudderStack dashboard.
  2. In the Connect warehouse section, select the warehouse connection from the list of available connections. If there is no warehouse connection available, click Add account to create a new connection.
Connect warehouse account
info

Note that:

  • To create a data graph, your RudderStack workspace must have at least one warehouse connection configured.

  • You can only connect one warehouse account to a data graph.

  • RudderStack supports the following warehouses currently:

  1. Click Connect to connect the warehouse account to the data graph.

At this point, the data graph base definition (warehouse connection context) is established. You can now start defining the entities and events for the data graph.

2: Create an entity model

  1. In the Add component section, select Entity model.
Add entity model
  1. Choose the relevant Database, Schema, Table for the entity model.
  2. Select the relevant Primary key from the dropdown.
  3. To set the entity model as a root model, select Yes from the dropdown. Then, click Next.
Configure entity model
  1. Provide a name and description for the entity model.
  2. Click Create to save the model.

You can now continue by adding more models to the data graph.

3: Create an event model

  1. In the top right corner, click Add component and select Event.
Create event model
  1. Select the relevant Database and Schema for the event model.
info
If you configured a root model in the previous step, the Database and Schema fields will be pre-populated with the relevant values.
  1. In the Table field, select a relevant table from the dropdown that contains timestamp information.
  2. Select the relevant timestamp from the dropdown — this field defines the dimension of this event model. Then, click Next.
Configure event model
  1. Provide a name and description for the event model.
  2. Click Create to save the model.

You now have two models on the canvas of your data graph — an entity model and an event model.

4: Create relationships between models

There are two ways to create relationships between models:

By clicking on the model

  1. Click on the model from which you want to start the relationship.
Create relationship between entity and event model
  1. Click Add relationship under Relationships.
Create relationship between entity and event model
  1. In the relationship configuration view, select one of the existing models — you can also create a new model. Then, click Next.
Create relationship between entity and event model
  1. Provide a name for the relationship.
  2. Define the cardinality of the relationship. For example, as one customer can have many purchases, the cardinality should be 1:many.
  3. Define the Join keys used to define the join condition and relate the two tables.
Create relationship between entity and event model
  1. Click Create to save the relationship.

Using the drag-and-drop method

info
The drag and drop method is an alternate way of creating relationships between models. In this method, you visually connect one model with another on the canvas — a configuration pane opens where you can define the relationship details.

Suppose you have another entity model, Accounts, and you want to create a relationship between the entity model Customers (created previously) and this model.

Drag-and-drop relationship between entity and event model
  1. Click the + sign that appears on the right side of the Customers model.
  2. Drag the relationship line to the left of the Accounts model and drop it on the canvas.
  3. In the configuration pane, define the relationship details and the cardinality, for example, many:1, indicating that an account can have many customers.
Create drag-and-drop relationship between entity and event model
  1. Define the Join keys used to join the models, for example, Account Key.
  2. Click Create to save the relationship.
  3. Use the Auto Layout functionality (described in Step 4) to reorganize the graph.
Organized layout of the data graph

You can continue expanding your data graph with more entity and event models, and building relevant relationships between them.

Organize the layout

Once the data graph is created, the models may appear scattered on the canvas. Use the Auto Layout option on the bottom left of the canvas to organize the graph.

Sample data graph for an ecommerce store

See also


Questions? We're here to help.

Join the RudderStack Slack community or email us for support