Snowflake Data Sharing

Zero-Copy Cloning, Secure Views, Reader Accounts, Access Control, Live Data Sharing

Snowflake Data Sharing

Snowflake is a cloud data platform that provides a multitude of features, one of which is data sharing. Snowflake's unique architecture allows for secure and easy sharing of data between Snowflake accounts. This is done without the need for duplicating or moving the data. Here's a brief overview of Snowflake's data sharing capabilities:

What are Snowflake Data Sharing Key Features?

  1. Zero-Copy Cloning: Snowflake allows data to be shared without physically duplicating the data. Instead, it uses metadata pointers, ensuring that data is consistent, current, and instantly available.
  2. Secure Views: Snowflake provides the capability to share specific portions of your data without exposing the underlying tables. This is done using secure views which are similar to standard SQL views but with added security to prevent reverse engineering.
  3. Reader Accounts: If the receiving party doesn't have a Snowflake account, you can provide them with a "reader account". This allows them to query and view the shared data without having their own Snowflake account.
  4. Live Data Sharing: Shared data is always up-to-date. If the source data changes, those changes are immediately reflected in the shared data.
  5. Access Control: Data providers have granular control over who can access their shared data and what they can do with it.

How does Snowflake Data Sharing Works?

  1. Share Creation: The data provider (the Snowflake account that wants to share data) creates a share which is essentially a named object that represents a slice of data, like a table or a view.
  2. Grant Access: The data provider then grants access to the share for one or more consumer accounts. This doesn't give direct access to the underlying data but rather provides a "view" of the data.
  3. Data Consumption: On the consumer side, the shared data appears as an external database. Consumers can then query this external database as they would with any other database in Snowflake.

Snowflake Data Sharing Use Cases

  1. Data Exchanges and Marketplaces: Organizations can create data marketplaces where data providers can share datasets with potential consumers.
  2. Data Collaboration between Business Units: In large organizations, different business units can share data seamlessly without the need for ETL processes.
  3. Supply Chain Analytics: Companies can share data with their suppliers or distributors to optimize the supply chain.
  4. Data Monetization: Organizations can monetize their data by sharing it with partners, customers, or third parties.

Considerations

  • Security: Always ensure that only the necessary data is shared and that sensitive data is masked or tokenized.
  • Billing: Data providers do not incur charges for sharing data. However, the consumer incurs compute charges when querying shared data.
  • Data Governance: It's essential to have a robust data governance strategy in place to manage and monitor shared data.

In summary, Snowflake's data sharing feature is a powerful tool for organizations looking to share data seamlessly and securely without the complexities of traditional data exchange methods.

How to set up data sharing using Snowflake's SQL commands?

1. Data Provider Side:

Step 1: Create a Share

CREATE SHARE sample_share;

Step 2: Add Objects to the Share

Let's say you have a database sample_db and a table sample_table that you want to share.

Example: how to add objects to the Share


Step 3: Share with Consumer Account

To share with another Snowflake account, you need their account identifier.

Example: how to share with target account


2. Data Consumer Side:

Step 1: Create a Database from the Share

Once the data provider has shared the data, the consumer can create a database from the share.

CREATE DATABASE external_db FROM SHARE sample_share;


Step 2: Query the Data

Now, the consumer can query the data as they would with any other database.

SELECT * FROM external_db.sample_table;


Cleanup:

If you ever want to revoke or remove the share:

Data Provider:

Example code: Cleanup from data providers' side


Data Consumer:

Example code: Cleanup from data consumers' side


Please note that you should adjust the database, table, and share names to fit your specific requirements. Additionally, always ensure you have the appropriate permissions and roles set up before sharing or consuming data.

New Release
Share

Get in Touch to Learn More

See Why Users Love CastorDoc
Fantastic tool for data discovery and documentation

“[I like] The easy to use interface and the speed of finding the relevant assets that you're looking for in your database. I also really enjoy the score given to each table, [which] lets you prioritize the results of your queries by how often certain data is used.” - Michal P., Head of Data