Snowflake

Step-by-step guide to add Snowflake as a destination in RudderStack

Snowflake is a cloud-based data warehouse provided as Software-as-a-Service (SaaS). It offers all the features of a modern data warehouse, including scalability, ease of use, secure access to your data, accelerated analytics capabilities, and much more.

RudderStack allows you to configure Snowflake as a destination to dump your event data seamlessly.

Snowflake User Setup

To enable RudderStack access, please make sure you have an ACCOUNTADMIN, or an account that has MANAGE GRANTS.

The following sections illustrate how to create a virtual warehouse, a database, a role, and an user in Snowflake:

Creating a virtual warehouse

Create a X-Small warehouseby following the wizard on Snowflake's website as shown in the screenshot below:

You can set your data warehouse size as per your future data volume.

Alternatively, you can also use SQL to create a warehouse, as shown:

CREATE WAREHOUSE "RUDDER_WAREHOUSE"
WITH WAREHOUSE_SIZE = 'XSMALL'
WAREHOUSE_TYPE = 'STANDARD'
AUTO_SUSPEND = 600
AUTO_RESUME = TRUE;

It is recommended that you set AUTO_SUSPEND to ~10 mins, and enable AUTO_RESUME to avoid any extra costs.

Creating a database

Please create a new database to avoid conflicts with your existing data, as RudderStack creates its own tables.

The following screenshot demonstrates the Create Database option in Snowflake.

Creating a database in Snowflake

Alternatively, you can also use SQL to create a database, as shown:

CREATE DATABASE "RUDDER_EVENTS";

Creating a role for RudderStack

Please execute the following SQL commands to create a new role with the required permissions to load your data into the warehouse:

  • Create a new role

CREATE ROLE "RUDDER";
  • Grant access to the virtual warehouse

GRANT USAGE ON WAREHOUSE "RUDDER_WAREHOUSE" TO ROLE "RUDDER";
  • Grant access to the database

GRANT USAGE ON DATABASE "RUDDER_EVENTS" TO ROLE "RUDDER";
GRANT CREATE SCHEMA ON DATABASE "RUDDER_EVENTS" TO ROLE "RUDDER";

Creating a user

Finally, please create a user to connect RudderStack to the previously created Snowflake warehouse, as shown:

Creating a user in Snowflake

Alternatively, you can use SQL to create a user in Snowflake, as shown:

CREATE USER "RUDDER_USER"
MUST_CHANGE_PASSWORD = FALSE
DEFAULT_ROLE = "RUDDER"
PASSWORD = "strong_unique_password";
GRANT ROLE "RUDDER" TO USER "RUDDER_USER";

Configuring Snowflake in RudderStack

In order to enable dumping data to Snowflake, you will first need to add it as a destination to the source from which you are sending event data. Once the destination is enabled, events from RudderStack will start to flow to Snowflake.

To do so, please follow these steps:

  • Choose a source to which you would like to add Snowflake as a destination. You can also simply create a destination and connect it to a source later.

Please follow our Adding a Source and Destination guide to know how to add a source in RudderStack.

  • After choosing a source, select Snowflake from the list of destinations.

  • Give your destination a name and then click on Next. You should then see the following screen:

Connection Settings for Snowflake in RudderStack
  • Add the required credentials in the Connection Settings as described below:

    • Account - This is the account ID of your warehouse. Account ID is part of the snowflake url. The following examples illustrate the slight differences in the account ID for various cloud providers.

    Account ID sample

    Snowflake URL

    Snowflake cloud provider

    qya56091.us-east-1

    https://qya56091.us-east-1.snowflakecomputing.com

    Amazon Web Services (AWS)

    rx18795.east-us-2.azure

    https://rx18795.east-us-2.azure.snowflakecomputing.com

    Microsoft Azure (Azure)

    ah76025.us-central1.gcp

    https://ah76025.us-central1.gcp.snowflakecomputing.com

    Google Cloud Platform (GCP)

    • Database - The name of the database, as created in the Creating a database section

    • Warehouse - The name of the warehouse, as created in the Creating a virtual warehouse section

    • User - This is the username, as created in Creating a user section.

    • Password - This is the password, as created in Creating a user section.

    • S3 bucket name - This is your unique S3 bucket name

    • AWS Access Key ID - This can be obtained from the AWS Console.

    • AWS Secret Access Key - This can be obtained from AWS Console. Please refer to the Setting Up Amazon S3 section for more details.

Contact Us

If you come across any issues while configuring Snowflake with RudderStack, please feel free to contact us or start a conversation on our Discord channel. We will be happy to help you.