Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docs/content/Configuration/Downstream/Superset.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ To allow queries from Superset to match pre-aggregations in Cube, [the
must be set to `true` in the pre-aggregation definition. This is because
Superset uses loose date ranges when generating SQL queries.

[ref-cube-getting-started-docker]: https://cube.dev/docs/getting-started/docker
[ref-getting-started]: /cloud/getting-started
[ref-schema-ref-preagg-allownonstrict]:
/schema/reference/pre-aggregations#allow-non-strict-date-range-match
Expand Down
24 changes: 24 additions & 0 deletions docs/content/Getting-Started/Cloud/01-Overview.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
title: Getting started with Cube Cloud
permalink: /getting-started/cloud/overview
category: Getting Started
subCategory: Cube Cloud
menuOrder: 2
---

First, we'll create a new deployment, connect it to a database, and generate a
data model from it. Then, we'll run queries using the Developer Playground and
APIs. Finally, we'll add a pre-aggregation to optimize query latency down to
milliseconds.

This guide will walk you through the following tasks:

- [Create a new deployment](/getting-started/cloud/create-a-deployment)
- [Generate a data model from a connected data source](/getting-started/cloud/generate-models)
- [Run queries using the Developer Playground and APIs](/getting-started/cloud/query-data)
- [Add a pre-aggregation to optimize query performance](/getting-started/cloud/add-a-pre-aggregation)

If you'd prefer to run Cube locally, then you can refer to [Getting Started
using Cube Core][ref-getting-started-core-overview] instead.

[ref-getting-started-core-overview]: /getting-started/core/overview
125 changes: 125 additions & 0 deletions docs/content/Getting-Started/Cloud/02-Create-a-deployment.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
---
title: Create a deployment
permalink: /getting-started/cloud/create-a-deployment
category: Getting Started
subCategory: Cube Cloud
menuOrder: 3
---

In this step, we will create a new deployment in Cube Cloud. A deployment
represents a data model, configuration, and managed infrastructure. We will use
it to connect a data source and generate data models.

## Create an account

To continue with this guide, you'll need to have a Cube Cloud account. If you
don't have one yet, [click here to sign up][cube-cloud-signup] for free.

## Create a deployment

First, [sign in to your Cube Cloud account][cube-cloud-signin]. Then,
click&nbsp;<Btn>Create Deployment</Btn>:

<div style="text-align: center">
<img
alt="Cube Cloud Landing Screen with no configured deployments"
src="https://ucarecdn.com/f3ec1ae0-1d5d-4b5b-9859-9fc145b38e43/"
style="border: none"
width="80%"
/>
</div>

Give the deployment a name, select the cloud provider and region of your choice,
and click <Btn>Next</Btn>:

<div style="text-align: center">
<img
alt="Cube Cloud Create Deployment Screen"
src="https://ucarecdn.com/2338323e-0db8-4224-8e7a-3b4daf9c60ec/"
style="border: none"
width="80%"
/>
</div>

## Set up a Cube project

Next, click <Btn>Create</Btn> to create a new project from scratch:

<div style="text-align: center">
<img
alt="Cube Cloud Upload Project Screen"
src="https://ucarecdn.com/46b72b61-b650-4271-808d-55203f1c8d8b/"
style="border: none"
width="80%"
/>
</div>

## Connect a data source

The last step in creating a deployment is to connect your data source to Cube
Cloud. First, select the data source from the grid:

<div style="text-align: center">
<img
alt="Cube Cloud Setup Database Screen"
src="https://ucarecdn.com/1d656ba9-dd83-4ff4-a59e-8b5f97a9ddcc/"
style="border: none"
width="80%"
/>
</div>

<InfoBox>

Want to use a sample database instead? Select <Btn>PostgreSQL</Btn> and use the
credentials below:

<br />

| Field | Value |
| -------- | ------------------ |
| Host | `demo-db.cube.dev` |
| Port | `5432` |
| Database | `ecom` |
| Username | `cube` |
| Password | `12345` |

</InfoBox>

After selecting the data source, enter valid credentials for it and
click&nbsp;<Btn>Apply</Btn>. Check the [Connecting to Databases][ref-conf-db]
page for more details on specific data sources.

<div style="text-align: center">
<img
alt="Cube Cloud Setup Database Screen"
src="https://ucarecdn.com/1ccdb149-bcf3-4426-9103-986f092939b7/"
style="border: none"
width="80%"
/>
</div>

If you run into issues here, make sure to allow inbound connections from Cube
Cloud IP addresses to your database. This means you need to enable these IPs in
your firewall. Using the screenshot in the example above, if you are using AWS,
this would mean adding new [rules][aws-docs-sec-group-rule] to your database's
[security group][aws-docs-sec-group]:

| Source | Protocol | Port range |
| --------------- | -------- | ---------- |
| `3.65.255.79` | `TCP` | `5432` |
| `3.69.4.168` | `TCP` | `5432` |
| `3.64.153.169` | `TCP` | `5432` |
| `18.185.128.84` | `TCP` | `5432` |

Now that the deployment is configured, we can move on to [generating data
models][ref-getting-started-cloud-generate-models].

[aws-docs-sec-group]:
https://docs.aws.amazon.com/vpc/latest/userguide/security-groups.html
[aws-docs-sec-group-rule]:
https://docs.aws.amazon.com/vpc/latest/userguide/security-group-rules.html
[cube-cloud-signin]: https://cubecloud.dev/auth
[cube-cloud-signup]: https://cubecloud.dev/auth/signup
[ref-conf-db]: /config/databases
[ref-getting-started-cloud-generate-models]:
/getting-started/cloud/generate-models
104 changes: 104 additions & 0 deletions docs/content/Getting-Started/Cloud/03-Generate-models.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
---
title: Generate data models
permalink: /getting-started/cloud/generate-models
category: Getting Started
subCategory: Cube Cloud
menuOrder: 4
---

In this step, you will generate data models using the connected data source from
the last step.

Cube's data models provide a declarative way to define important facts about
your data and relationships between them. You can create data models from
scratch or let Cube generate an initial version for you.

## Select tables

Start by selecting the database tables to generate the data schema from, then
click <Btn>Measures and Dimensions</Btn>:

<div style="text-align: center">
<img
alt="Cube Cloud Generate Models Screen detected tables from data source for selection"
src="https://ucarecdn.com/e0420b86-64bc-4e01-aa74-16a7e926f523/"
style="border: none"
width="80%"
/>
</div>

## Measures and dimensions

Next, you'll see all detected measures and dimensions from the data source.
Click <Btn>Primary Keys</Btn> to progress to the next step:

<div style="text-align: center">
<img
alt="Cube Cloud Generate Models Screen showing detected measures and dimensions"
src="https://ucarecdn.com/e0f8e8c3-9961-4360-ab9f-cfd96306c832/"
style="border: none"
width="80%"
/>
</div>

## Primary keys

Review the detected primary keys for each cube and click <Btn>Joins</Btn> to
move to the next step:

<div style="text-align: center">
<img
alt="Cube Cloud Generate Models Screen showing detected primary keys"
src="https://ucarecdn.com/e13e8279-e9e9-40df-b8f6-8cf5bb34ee14/"
style="border: none"
width="80%"
/>
</div>

## Joins

Once again, review the detected joins and relationships and click

<Btn>Review</Btn>:

<div style="text-align: center">
<img
alt="Cube Cloud Generate Models Screen showing detected joins"
src="https://ucarecdn.com/8190bd70-e4e3-4e9f-9cee-e9416ddf964b/"
style="border: none"
width="80%"
/>
</div>

## Review

The last screen allows you to review all the detected cubes and their
corresponding measures, dimensions, and joins. If everything looks good, pick
either <Btn>YAML</Btn> (recommended) or <Btn>JavaScript</Btn> format and
click&nbsp;<Btn>Confirm & Generate</Btn>:

<div style="text-align: center">
<img
alt="Cube Cloud Generate Models Screen showing review screen"
src="https://ucarecdn.com/59e18ad2-b8fc-48dc-b409-d829579048f5/"
style="border: none"
width="80%"
/>
</div>

Cube Cloud will now generate the models and spin up your Cube deployment, and in
a few moments you should see the following screen:

<div style="text-align: center">
<img
alt="Cube Cloud Deployment Overview Screen"
src="https://ucarecdn.com/7fa603ae-6100-4492-91e4-564d311f701e/"
style="border: none"
width="80%"
/>
</div>

You're now ready for the next step, [querying the
data][ref-getting-started-cloud-query-cube].

[ref-getting-started-cloud-query-cube]: /getting-started/cloud/query-data
Loading