Utilize the power and scalability of Snowflake.
We’ve long seen that the data experiences landscape has been very diverse. From dozens of general-purpose BIs to hundreds of vertical purpose-built analytical solutions, data consumers have many, many options to visualize and consume data.
The evolution of front-end technologies made it possible to embed quality analytics experiences directly into many software products, further accelerating the proliferation of data products and experiences.
Cube works on top of Snowflake with direct queries and doesn’t require you to run extracts hence your data always remains in Snowflake.
What is a Semantic Layer?
A semantic layer is a middleware between your cloud data warehouse, such as Snowflake, and downstream applications. It abstracts raw data and presents it in a meaningful way to the end-user and serves as a contextual filter between the data warehouse and the various analytical tools that businesses use to slice, dice, and analyze their data.
Why Cube and Snowflake?
Future-proof data stack. Snowflake established itself as the center of gravity in a modern data stack, a new approach to data engineering that enables teams to pursue higher-value activities.
Modern data stack follows several foundational principles and architecture designs:
- Using a cloud data warehouse like Snowflake as a central data platform
- ELT vs. ETL
- Applying software engineering best practices to data management
Cube embraces software engineering best practices and allows data engineers to manage data model in code. This enables leveraging the version control systems to manage data model evolution safely and facilitate collaboration and code reviews. It also makes it possible to have a semantic layer as a part of the CI/CD process and have isolated environments for development, staging, and production.
Utilize the power and scalability of Snowflake. Cube works on top of Snowflake with direct queries and doesn’t require you to run extracts hence your data always remains in Snowflake. Cube pushes compute down to your Snowflake instance, fully utilizing the power and scalability of your cloud data warehouse. You can optionally create pre-aggregations in Cube and enable aggregate awareness to not query your Snowflake instance with small repeated queries but rather update aggregates in the background.
A step-by-step guide to building semantic layer with Cube and Snowflake
In the below section, we’ll cover a quickstart step-by-step tutorial on how to start with Cube and Snowflake. Cube Cloud is free to start, and you can sign up anytime. No credit card or calls with salespeople are required!
You can find a detailed getting started guide in Cube documentation.
Create Snowflake and Cube accounts
First, create Cube Cloud and Snowflake accounts.
If you don’t have a dataset that you would like to use, you can follow this guide to create a test dataset in your Snowflake instance.
Connect Snowflake to Cube
Please follow these steps to create your first deployment in Cube Cloud and connect it to your Snowflake instance.
After you sign in to your Cube Cloud account, click “Create Deployment”.
Give the deployment a name, select the cloud provider and region of your choice, and click “Next”.
Next, click Create to create a new project from scratch.
Select Snowflake from the list of supported data sources and enter your Snowflake credentials to connect to it.
Once Snowflake is connected, Cube can generate a basic data model from your data warehouse schema, which helps you get started with data modeling faster. We'll inspect these generated files in the next section and start changing them.
Create your data model
Cube follows a dataset-oriented data modeling approach, which is inspired by and expands upon dimensional modeling.
When building a data mode in Cube, you work with two dataset-centric objects: cubes and views. Cubes usually represent business entities such as customers, line items, and orders. In cubes, you define all the calculations within the measures and dimensions of these entities.
To begin building your data model, click on “Enter Development Mode” in Cube Cloud. This will take you to your personal developer space.
Once you are in developer mode, navigate to the “Data Model” and click on any file located in the left sidebar to open it.
You can follow this detailed guide on how to make changes to your data model and build new measures and dimensions.
When you are ready to test updates to your data model, you can navigate to Cube’s Playground. The Playground is a web-based tool that allows you to query your data without connecting any tools or writing any code.
Query your data
You can query Cube using a BI or visualization tool through the Cube SQL API. For a better experience, we recommend mapping the BI's data model to Cube's semantic layer. This can be done automatically with Semantic Layer Sync or manually.
Semantic Layer Sync Semantic Layer Sync will synchronize all public cubes and views with connected BI tools.
- Create a new sync by navigating to the “Semantic Layer Sync” tab on the “BI Integrations” page and clicking “+ Create Sync”.
- Follow the steps in the wizard to create a sync
- Replace the fields for user, password, and URL with your BI tool credentials, then click on “Save All”. You can now go to the “BI Integrations” page and trigger the synchronization of your newly created semantic layer.
- After running the sync, navigate to your BI tool instance. You should see the orders_view dataset that was created in the tool. Cube automatically maps all metrics and dimensions in the BI tool to measures and dimensions in the Cube data model.
Manual setup Alternatively, you can connect to Cube and create all the mappings manually.
- You can find the credentials to connect to Cube on the “BI Integrations” page under the “SQL API Connection” tab.
- After connecting, create a new dataset in the BI tool and select "orders_view" as a table.
- Now you can map the BI tool metrics and columns to Cube's measures and dimensions.
That was a high level preview. You can create both you Snowflake and Cube instance for free to try it out in your own environment.
...and you are ready to go...
The combination of Cube and Snowflake help to untangle the complexities of data modeling and empowers organizations to streamline their analytics efforts. Through step-by-step guidance, the blog has illuminated the path to creating a powerful semantic layer, enabling users to harness the true potential of their data and drive insightful decision-making.
Recorded workshop Getting Started with Cube on Snowflake
Detail on connecting to Snowflake