Tutorial: Get started with the web app of a Snowflake Data Clean Room¶
Introduction¶
A Snowflake Data Clean Room is a cryptographically secure environment that allows entities to collaborate on sensitive data. It allows an entity to share its data with a collaborator while maintaining the privacy of the data by tightly controlling what can be done with it.
This tutorial leads you through the basic flow of using the web app to work with a Snowflake Data Clean Room.
What you will learn¶
In this tutorial, you will learn how to do the following in the web app:
Add a collaborator to your clean room environment.
Create a clean room, including how to add data, specify join policies, define which type of analysis a collaborator can run on the data, and share the clean room with a collaborator.
Install a clean room, including how to add data and define how this data is joined with the collaborator’s data.
Run an analysis, including how to create a new analysis based on what is allowed in the clean room and specify relevant parameters for the analysis.
Activate the results of the analysis.
About clean room collaborators¶
Clean room collaborators are either providers or consumers.
A provider is the entity sharing their data with other clean room collaborators. They create and configure the clean room in order to maintain the privacy of the data that they are sharing.
A consumer is the entity using the clean room to interact with the shared data. The consumer can analyze and query the data within the clean room, including joining and enriching it with their own data.
In this tutorial, you will act as both the provider and the consumer of the clean room.
Prerequisites¶
Before completing this tutorial, an administrator must set up the clean room environment and configure the Snowflake account associated with it. This must be done for both the provider account and the consumer account. For details on how to perform these actions, see Get started with Snowflake Data Clean Rooms.
To act as a consumer for the purposes of this tutorial, you must have access to a second Snowflake account associated with a second clean room. This allows you to mimic how a consumer installs and uses the clean room. If you do not have a second account, you can still use this tutorial to learn how to create, configure, and share a clean room.
If you are not the administrator who set up the clean rooms, a clean room administrator also needs to add you as an user for the web app. You need to be an admin user in the clean room environment.
Sign in to the web app as a provider¶
In this section you will sign in to the clean room where you will create, configure, and share a clean room as a provider.
To sign in to the web app as a provider:
Navigate to the Snowflake Data Clean Rooms login page.
For this tutorial, you must be a user with the Admin role.
Enter your email address, and select Continue.
Enter your password.
If you are associated with multiple clean room environments, select the Snowflake account you want to use as the provider account.
Add the consumer as a collaborator¶
In this section you will add the consumer account you are using for this tutorial as a collaborator. Administrators must define someone as a collaborator before other users can share a clean room with that collaborator.
To add the consumer as a collaborator:
In the left navigation, select Collaborators.
Select the Snowflake Partners tab.
Select + Snowflake Partner.
In the Company Name field, enter
Tutorial Consumer
.In the Email Address field, enter the email associated with your clean room user.
In the Account Locator field, enter the account locator of the Snowflake account you are using to simulate the consumer experience.
Select the cloud and region of the account you are using to simulate the consumer experience.
Select Add.
Sign in to the web app as a consumer¶
In this section, you are switching from being the provider who created and shared the clean room to the consumer who is installing the clean room. You are installing the clean room in a different account to mimic how a consumer would install and use the clean room in their own account.
To sign in to the web app as a consumer:
Navigate to the Snowflake Data Clean Rooms login page.
Enter your email address, and select Continue.
Enter your password.
If you are associated with multiple clean room environments, select the Snowflake account you want to use as the consumer account.
Install and configure the clean room¶
In this section you will:
Install the clean room that was shared with you from the provider account.
Add data to the clean room so it can be joined with the provider’s data.
Add a join policy to define how the consumer data and the provider data are related.
Define the columns that analysts can use to create segments, filter results, and enrich activation data.
Start the installation process¶
To start installing a clean room that has been shared by the provider account:
In the left navigation, select Clean Rooms.
Select the Invited tab.
Find the
Tutorial
tile, and select Join.
Add consumer data to the clean room¶
To add data to the clean room:
In the Datasource section, select
Snowflake
.From the Tables drop-down list, select the
DEMO.CUSTOMERS
table. This table is located under theSAMOOHA_SAMPLE_DATABASE
database.Select Next.
Define a join policy¶
Consumers use a join policy to specify which columns are joined in an analysis or query, thereby defining the relationship between provider tables and consumer tables.
To define a join policy:
Ensure that the columns from the consumer’s table (My Columns) and the columns from the provider’s table (Collaborator Columns ) match. For example, the consumer’s
HASHED_EMAIL
column should be joined with the provider’sHASHED_EMAIL
column. You specified that collaborators are only allowed to join on these columns when you created the clean room.Select Next.
Define the segmentation and activation columns¶
When you select segmentation and activation columns during the clean room installation process, you are defining which columns are available to users running analyses in the clean room. Analysts can only create a segment based on these columns. When sending activation data back to the provider, analysts cannot enrich the results of the analysis with data unless it comes from one of these columns.
To define the segmentation and activation columns:
From the Tables drop-down list, select the
DEMO.CUSTOMERS
table.From the Segmentation & Activation Columns drop-down list, select the following columns:
INCOME_BRACKET
REGION_CODE
STATUS
Select Finish.
You need to wait until the clean room is installed before continuing with this tutorial. Periodically select Refresh until the
Tutorial
tile changes from Processing to Run.
Run an analysis¶
In this section you will run an audience overlap and segmentation analysis in the clean room.
To run an analysis:
In the left navigation, select Clean Rooms.
Select the Joined tab.
Find the
Tutorial
tile, and select Run.Select the
Audience Overlap & Segmentation
tile, then select Proceed.In My Tables, select
Customers
.In Collaborator Table, select
Customers
.In My Join Columns, define the following joins:
From the drop-down list, select
HASHED_EMAIL
.Select + Join Column, then select
HASHED_FIRST_NAME
andHASHED_LAST_NAME
.Select + Join Column, then select
HASHED_PHONE
.
When you run an analysis in the clean room, results will include records where any of the following is true:
The
HASHED_EMAIL
in the consumer’s table matches theHASHED_EMAIL
in the provider’s table.The consumer’s
HASHED_FIRST_NAME
matches the provider’sHASHED_FIRST_NAME
and the consumer’sHASHED_LAST_NAME
matches the provider’sHASHED_LAST_NAME
.The consumer’s
HASHED_PHONE
matches the provider’sHASHED_PHONE
.
In the User Segmentation section, do the following:
From the My Columns drop-down list, select
INCOME_BRACKET
.From the Collaborator Columns drop-down list, select
AGE_BAND
.
The results of the analysis will be grouped into these segments.
In the Filters section, use the drop-down lists to define
DEMO.CUSTOMERS.STATUS = GOLD
. Be sure to use the color coding to select the column in the consumer account (My Columns
).The
STATUS
of a record in the consumer table must beGOLD
in order to be included in the analysis results.Select Run.
Use the Results section to see your results. You can toggle your results metric between match rate and overlap count.
To see the segmentation groups of your analysis, select Download and open the comma-delimited file.
Continue to the next step in the tutorial to send enriched results back to the provider for activation.
Activate the results¶
In this section you will activate the results of your analysis by pushing them back to the provider’s Snowflake account. These results will be enriched with data from the consumer and provider tables.
To activate the results of the analysis:
Within the Results section, select Activate.
Select the name of the provider account you used to share the clean room.
In the Segment Name field, specify
Provider Snowflake Account
.From the ID Columns drop-down list, select
HASHED_EMAIL
.From the Attribute Columns drop-down list, select Select All. When the provider looks at the results of the analysis, the matched records will be enriched with the additional data found in these columns.
You’ll notice that the available columns are the same as the segmentation and activation columns that you selected as the provider when configuring the clean room along with the segmentation and activation columns that you selected as the consumer when installing the clean room.
Select Push Data.
Congratulations! You have now installed and configured a clean room in a consumer account, run an analysis, and pushed the results back to the provider account for activation.
View the activation data as the provider¶
In this section, you are switching back to the role of the provider to view the results of the consumer’s activation. Consumer activation
data is stored in the SAMOOHA_BY_SNOWFLAKE_LOCAL_DB.PUBLIC.PROVIDER_ACTIVATION_SUMMARY
table of the provider’s Snowflake account.
Before using Snowsight to query this table, you must sign in to the clean room environment to create the pipeline between the consumer account and the provider account.
To sign in to the clean room environment as a provider:
Navigate to the Snowflake Data Clean Rooms login page.
Enter your email address, and select Continue.
Enter your password.
If you are associated with multiple clean room environments, select the Snowflake account you used as the provider account for this tutorial.
After the pipeline is built successfully, you can view the activation data using a SQL query or using the database object explorer in Snowsight:
Sign in to Snowsight for the provider account. You are signing in to the Snowflake account, not the clean room environment.
In the left navigation, select Data » Database.
Navigate to
SAMOOHA_BY_SNOWFLAKE_LOCAL_DB
»PUBLIC
»Tables
»PROVIDER_ACTIVATION_SUMMARY
.Select Data Preview to view the activation data.
Sign in to Snowsight for the provider account. You are signing in to the Snowflake account, not the clean room environment.
Open Projects » Worksheets.
Select + » SQL Worksheet.
In the new worksheet, paste and run the following statement to list the activation data that was pushed from the consumer’s clean room environment.
SELECT * FROM samooha_by_snowflake_local_db.public.provider_activation_summary WHERE segment = 'Provider Snowflake Account';
Clean up¶
You can delete the clean room and activation data that you created for this tutorial to clean up your production environment.
Delete the activation data¶
To delete the activation data from the provider’s Snowflake account:
Sign in to Snowsight for the provider account. You are signing in to the Snowflake account, not the clean room environment.
Open Projects » Worksheets.
Select + » SQL Worksheet.
In the new worksheet, paste and run the following statement to delete the activation data created for this tutorial:
DELETE FROM samooha_by_snowflake_local_db.public.provider_activation_summary WHERE segment = 'Provider Snowflake Account';
Delete the clean room¶
Deleting a clean room in the provider account removes it from both the provider account and the consumer account.
To delete a clean room:
Navigate to the Snowflake Data Clean Rooms login page.
Enter your email address, and select Continue.
Enter your password.
Select the Snowflake account that you used as the provider account.
In the left navigation, select Clean Rooms.
On the Created tab, find the
Tutorial
tile and select the More icon ().Select Delete.
Select Proceed.
Learn more¶
Congratulations! You have now used the web app to create and share a clean room as a provider. You have also acted as the consumer who is using the clean room to analyze data within a privacy-preserving environment.
You can use the following resources to learn more:
For general information, see About Snowflake Data Clean Rooms.
For more information about the web app, see Snowflake Data Clean Rooms: Web app overview.
For information about using the developer APIs to work with a Snowflake Data Clean Room programmatically, see Snowflake Data Clean Rooms: Developer APIs overview.