12 Jan 2025

The Who, Where, What, How, and When of Snowflake Shares

Snowflake Shares enable secure, seamless data sharing across accounts and organizations without the need for data duplication. This guide explores the who, where, what, how, and when of Snowflake Shares to help you maximize their utility.


Who Uses Snowflake Shares?

Snowflake Shares are utilized by:

  • Data Engineers: To manage and distribute datasets securely.
  • Data Analysts: For accessing shared datasets without the need for local storage.
  • Business Partners: To collaborate on data-driven projects.
  • Data Providers: For offering data products to customers or partners.
  • Data Scientists: To gain insights from shared data for advanced analytics and modeling.

Where Are Snowflake Shares Used?

Snowflake Shares are applied in:

  • Data Collaboration: Sharing data securely with internal or external teams.
  • Third-Party Data Access: Providing partners with real-time access to datasets.
  • Data Monetization: Selling data products through Snowflake’s Data Marketplace.
  • Multi-Region Analytics: Distributing data across geographic locations for analysis.
  • Compliance and Reporting: Sharing regulated data with auditors or regulators.

What Are Snowflake Shares?

Snowflake Shares are objects that enable secure, read-only access to data in a Snowflake account for other accounts. Shares do not require copying or moving data, ensuring efficiency and data consistency.

Key Features

  • Zero Copy: Shares do not duplicate data, reducing storage costs and ensuring real-time updates.
  • Granular Control: Grant access to specific databases, schemas, tables, or views.
  • Secure Sharing: Enforce role-based access control and encryption.
  • Cross-Account Sharing: Share data with any Snowflake account globally.
  • Data Marketplace Integration: Publish shares on Snowflake’s marketplace for broader distribution.

Components of a Share

  1. Provider Account: The account creating and sharing the data.
  2. Consumer Account: The account accessing the shared data.
  3. Shared Objects: Databases, schemas, or tables included in the share.
  4. Access Control: Permissions defining what the consumer can access.

How Do Snowflake Shares Work?

1. Creating a Share

Define a share in the provider account to specify which data is shared.

Example: Creating a Share

CREATE SHARE sales_share;
GRANT USAGE ON DATABASE sales_db TO SHARE sales_share;
GRANT SELECT ON ALL TABLES IN SCHEMA sales_db.public TO SHARE sales_share;

2. Adding Consumers to a Share

Allow another Snowflake account to access the share by adding their account ID:

ALTER SHARE sales_share ADD ACCOUNTS = ('consumer_account_id');

3. Consuming a Share

Consumers create a database from the share to access the shared data:

CREATE DATABASE shared_sales_db FROM SHARE provider_account.sales_share;

4. Managing Shares

  • View Existing Shares:
    SHOW SHARES;
    
  • Drop a Share:
    DROP SHARE sales_share;
    

When Should You Use Snowflake Shares?

1. Data Collaboration

  • When: Teams need to share data across departments or organizations securely.

2. Third-Party Data Distribution

  • When: Sharing live, real-time datasets with partners or customers.

3. Data Marketplace Publishing

  • When: Offering data products for monetization or broader consumption.

4. Reducing Data Duplication

  • When: Minimizing storage costs by sharing data instead of duplicating it.

5. Compliance and Auditing

  • When: Providing external auditors with access to regulated datasets.

Best Practices for Snowflake Shares

  1. Secure Shared Data:
    • Use role-based access control to restrict consumer access.
  2. Keep Shares Updated:
    • Regularly review and update shares to include or exclude datasets as needed.
  3. Monitor Usage:
    • Use ACCOUNT_USAGE and SHARES metadata to track share activity.
  4. Leverage Data Marketplace:
    • Publish shares on Snowflake’s marketplace to reach a wider audience.
  5. Test Before Sharing:
    • Validate data and permissions in a development environment before enabling access for consumers.

Conclusion

Snowflake Shares provide a robust mechanism for secure, efficient, and real-time data sharing, enabling seamless collaboration and data monetization. By understanding their features and following best practices, you can leverage Snowflake Shares to unlock new opportunities for collaboration and business growth.

Start using Snowflake Shares today to simplify and enhance your data sharing workflows.



Tags:
0 comments