Data Model

Data Model

With the web-based data model editor, you can write and test and your Cube data model from your browser.

Data model editor is available in Cube Cloud on all tiers (opens in a new tab).

Cube Cloud can create branch-based development API instances to quickly test changes in the data model in your frontend applications before pushing them into production.

Development Mode

In development mode, you can safely make changes to your project without affecting production deployment. Development mode uses a separate Git branch and allows testing your changes in Playground or via a separate API endpoint specific to this branch. This development API hot-reloads your data model changes, allowing you to quickly test API changes from your applications.

To enter development mode, navigate to the Data Model screen and click Enter Development Mode.

When development mode is active, a grey bar will be visible at the top of the screen. It provides several useful controls and indicators:

  • The name of the current development Git branch
  • The status of the development API. After any changes to the project, the API will hot-reload, and the API status will indicate when it's ready.
  • 'Copy API URL' will copy the API URL to the clipboard for the current development branch.

You can exit development mode by clicking Exit in the grey banner. If you've been editing a data model and navigate away, Cube Cloud will warn you if there are any unsaved changes:

Unsaved changes warning modal

Data Graph

In addition to exploring the code of data model files, you can view the visual representation of the data model, including relations between cubes. Click Show Graph in the top right part of the data model editor to open Data Graph:

Data Graph visualizes cubes and joins between them as an entity-relationship diagram (opens in a new tab) (ERD). It allows to have a bird's-eye view of the data model and visually detect connected parts, i.e., groups of cubes that don't have any relationships with other groups.

For clarity, only dimensions and custom SQL expressions used in joins are shown. Join relationship types are depicted with the crow's foot notation:

  • Dash represents one in one_to_one and one_to_many types
  • Crow's foot represents many in one_to_many and many_to_one types

You can pan and zoom the visualization, search cubes using the input box, hover over cubes to highlight their relationships, and click Show Code to view their code.

Git integration

To add more Git branches to your Cube Cloud deployment and/or switch between them, click the branch name in the status bar:

Branch switcher

Speaking of Git branches, you can now easily add and remove branches with the same switcher; click Add Branch and enter a name for the new branch in the popup:

Create a new branch

These branches are shared, meaning everyone who has access to the deployment can see and edit them. This makes them extremely useful for out-of-band experiments where you can quickly test things in Cube Cloud without having to go through a CI/CD process.

Unused branches can also be deleted. Ensure you are already on the branch you want to delete, then open the switcher and click Remove Branch:

Delete a branch

Generating models

Cube Cloud supports generating models from a data source after the initial deployment creation. The Generate Data Model on the Data Model page will let you re-generate models from your source database, or alternatively add rollups to existing data models:

Generate rollups or data model modal