Snowflake : Data Sharing in Snowflake

Snowflake

Data Sharing is a unique feature of Snowflake that enables organizations to securely share data across different Snowflake accounts. This feature is especially useful for organizations that need to share data with their partners, customers, or other departments within the organization.

To understand how Data Sharing works in Snowflake, let’s consider the following example:

Suppose that ABC Company has a Snowflake account that contains customer data. ABC Company wants to share this data with their partner XYZ Company, but they do not want to give XYZ Company access to their entire Snowflake account.

To achieve this, ABC Company can create a Data Sharing object in their Snowflake account, which contains the customer data that they want to share with XYZ Company. They can then grant access to this Data Sharing object to the Snowflake account of XYZ Company.

Once XYZ Company has been granted access to the Data Sharing object, they can create a database or schema within their own Snowflake account that references the shared data. This means that they can query the data as if it were their own, without having to move or copy the data into their own account.

For example, if ABC Company’s Data Sharing object contains a table called “customer_orders”, XYZ Company can create a schema within their own Snowflake account that references this table:

CREATE SCHEMA abc_company_shared_data;

CREATE TABLE abc_company_shared_data.customer_orders AS
SELECT * FROM snowflake_account_shared_data.customer_orders;
In the above example, the “snowflake_account_shared_data” is the name of the Data Sharing object in ABC Company’s Snowflake account, and “abc_company_shared_data” is the name of the schema that XYZ Company has created within their own account.

Once the schema has been created, XYZ Company can query the “customer_orders” table as if it were their own:

SELECT *
FROM abc_company_shared_data.customer_orders
WHERE order_date >= '2023-03-08';

It’s important to note that Data Sharing in Snowflake is secure and flexible. The data owner (ABC Company in this example) has full control over who can access their shared data and can revoke access at any time. Additionally, the data consumer (XYZ Company in this example) can customize the schema that references the shared data and can perform their own transformations on the data if necessary.

Data Sharing is a powerful feature of Snowflake that enables organizations to securely share data across different Snowflake accounts. With Data Sharing, organizations can collaborate with their partners, customers, or other departments within the organization, while maintaining control over their own data.

Snowflake important urls to refer

Author: user

Leave a Reply