Cube has been an open-source project since 2018. We try our best to listen to the community and our users to make it the best analytics API server on the market today.

We really appreciate all the help and sincere dedication our lovely community has done to provide feedback, submit pull requests, and feature ideas to improve Cube even more. We hope the soon-to-be 12,000 stars on GitHub are a representation of our dedication to making our community happy.

In this article, I want to walk you through creating a new Cube App deployment on Cube Cloud and connecting it to your database.

If you prefer watching a video instead, have a look at this short 5 minute tutorial on our YouTube channel.

Before moving on I want to share a bit about the benefits of using Cube Cloud vs. self-hosting Cube yourself.

Why use Cube Cloud?

We launched Cube Cloud this October with the vision of making Cube accessible to everyone, no matter the scale and DevOps experience level.

You already know Cube is an open-source project with almost 12,000 stars on GitHub. It's packed full of cool features, such as auto-generating schemas, auto-generating dashboards, a developer playground, and much more. It's easy to work with and developer-friendly.

Self-hosting Cube can come with its own set of complications due and pitfalls. Let me explain.

Managed Infrastructure

Cube requires several pieces of infrastructure to work reliably at scale. To get both high concurrency and high data size you need:

  • Compute resources
  • Redis
  • Cube Store
  • An API gateway
  • A refresh worker
  • A load balancer
  • optionally, a VPC configuration

You can mitigate this by using infrastructure as code tools like AWS CloudFormation, Pulumi, or Terraform, and using Kubernetes as a container orchestrator.

Monitoring and Scaling

Maintaining application up-time is a serious responsibility. To achieve this with self-hosting, you have to make sure that monitoring is configured for Cube and that you can scale Cube up if there's a spike in traffic.

With Cube Cloud, both monitoring and auto-scaling are available out-of-the-box.

You also get query monitoring in the Queries tab in the sidebar. The entire query history is available, including metrics like query result size and time spent, helping you dig into why some queries take longer than others.


You can see application performance metrics in the Metrics tab.



A major problem when scaling Cube apps is optimizing pre-aggregation build times. Similarly, when trying to determine the status of your pre-aggregations; you need to know whether they're built or not and when they were built.

In Cube Cloud, we can check out the Pre-Aggregations tab to see the status of all pre-aggregations in your Cube deployment, including whether they're building or not and even which of the partitions, if any, are being refreshed.


In production, these pre-aggregations are kept up-to-date automatically for you.

Development Tools

You get GitHub integration with Cube Cloud. Your deployment can watch a GitHub repository for changes and deploy updates. Connect a deployment to GitHub from the Settings page and you're set.


You can also make changes directly in the Cube Cloud console by entering Development Mode.


You get a dedicated Git branch, complete with a personal API URL and separate pre-aggregations.


If you have paying customers, having paid support is a lifesaver. If something breaks, and you need help fixing it, having someone to call is a lifesaver. Cube Cloud comes with support on the Enterprise plan, so you can ping us whenever you hit a snag!

Sign Up to Cube Cloud

Signing up is simple and secure because you can also choose to sign up with your GitHub account. Here's how you sign up.

Jump over to the sign-up page and enter your email.


Once you click Sign Up, you'll receive an email from us to set a password.


Next, you select a subdomain for your Cube Cloud account.


With all this out of the way, you can finally start creating Cube Deployments.


Let me explain how to create a deployment.

Create a Deployment in Cube Cloud

Creating a deployment consists of four main steps.

  1. Create Deployment
  2. Set Up the Cube App
  3. Set Up the Database Connection
  4. Generate the Data Schema

Let me break it down into even more detail.

Step 1 - Create Deployment

The first step of creating a Cube App from scratch in Cube Cloud is to create a deployment.

Once you click the create deployment button it'll open up the first step in the deployment creation UI flow.


Here you choose what name to give your deployment and pick the cloud provider and region. The reason why to choose either AWS or GCP is based on where you're hosting your own infrastructure and apps.

Let me give you an example. Let's say you have a metrics dashboard that needs to consume data on us-east-1 on AWS. Using the same AWS region to host the Cube deployment as where you are hosting this metrics dashboard will reduce the network delay and latency between Cube and your app.

Which database you're using is also important when choosing a cloud provider and region. If you have data in BigQuery then you should not choose AWS. If you're using AWS Redshift then vice-versa applies.

Need a Dedicated VPC?

A reason for using a VPC is if you expect high throughput of up to and above millions of requests per day. Using a VPC will give you a dedicated managed infrastructure that is ready to serve such high numbers of users.

Additionally, if your company required security compliance like SOC2, using a VPC is mandatory.

The best part is that a VPC is readily available for you if you need it. All you need to do is to reach out to us and ask for it. Super simple!


But, back to business. Let's get back to creating the Cube app deployment. After selecting a cloud provider and region, add a name for your deployment and click next.


Step 2 - Set Up the Cube App

Next up, the second step in creating a Cube App from scratch in Cube Cloud is to click the + create button.


But, before moving on, I want to ask if you already have a Cube app? If you do, please jump over to my co-worker Hassan's guide on migrating a Cube app to Cube Cloud.

In this tutorial, I want to stick to creating a Cube App from scratch, so let me continue where I left off.

Step 3 - Set Up the Database Connection

After selecting the + Create button and proceeding to create a Cube app from scratch, you'll be prompted to select a database type. This lets you choose from dozens of the most popular databases available on the market today.


I'll proceed with selecting PostgreSQL to hook up a sample e-commerce database to show you how simple it really is. The values I'll use are:


In the UI it'll look exactly like the image below.


Once you click the Apply button, Cube Cloud will test if the connection was successful, and proceed to the next step.

If you run into issues here, make sure to allow the Cube Cloud IPs to access your database. This means you need to open up your firewall to these IPs. In the case of AWS, this would mean adding a security group with allowed IPs.

Step 4 - Generate the Data Schema

Step four in this case consists of generating a data schema. Start by selecting the database tables to generate the data schema from, then hit generate.


Cube Cloud will generate the data schema and spin up your Cube deployment. With this, you're done. You've created a Cube deployment, configured a database connection, and generated a data schema!


You're ready to run queries in the Playground.

Running Queries in Cube Cloud's Playground

By clicking on the Playground in the left nav you'll open the Playground UI.

Here you can test queries by selecting from all the measures and dimensions in the data schema. This lets you test different dashboards and visualizations for when you want to build your own metrics dashboards.

The image below showcases a bar chart with an Orders Count measure, an **Orders Status dimension**, and an **Orders Created At time dimension** grouped by day for the current month.


You can use the playground as a testing ground for all queries you want to run in your own dashboards. The playground will also display how long a query took, showing you the response time above the chart itself.

That's it! You've finished creating a Cube Deployment on Cube Cloud.

What About Query Acceleration?

Congrats! You've configured a Cube app in Cube Cloud. You're ready to add pre-aggregations and run the deployment in cluster mode. We have detailed tutorials explaining these concepts for you to read here. You can follow along with the tutorial to add pre-aggregations to your data yourself.

We at Cube also hosted a workshop about pre-aggregations that you can take a look at to learn more about query acceleration.


Deploying a Cube App on Cube Cloud consists of four steps. First, select the cloud provider, region, and name. Second, select creating a Cube app from scratch, Third, connect a database. Fourth, generate a data schema.

You should keep in mind there are three ways of deploying Cube apps in Cube Cloud. You can create one from scratch, with the Cube CLI, or with the GitHub integration.

If you choose to use Cube Cloud, you'll get the added benefit of getting managed infrastructure that auto-scales to your needs. Cube Cloud also has some added features compared to self-hosting Cube, including query performance analysis, query response times, APM, and pre-aggregations enabled by default.

I hope you end up trying out Cube Cloud because you'll save time and energy by not managing infra and just focusing on building product value.

Sign up to Cube Cloud here to try it out for yourself.

Until next time, stay curious, and have fun coding. Also, feel free to leave Cube a ⭐ on GitHub if you liked this article. ✌️