In Snowflake, Shares are a fundamental feature that enables secure data sharing between Snowflake accounts without the need to copy or transfer data. This capability is a cornerstone of Snowflake's Data Sharing functionality, allowing organizations to collaborate efficiently while maintaining data …In Snowflake, Shares are a fundamental feature that enables secure data sharing between Snowflake accounts without the need to copy or transfer data. This capability is a cornerstone of Snowflake's Data Sharing functionality, allowing organizations to collaborate efficiently while maintaining data governance.
A Share is a named Snowflake object that encapsulates all the information required to share specific database objects with one or more consumer accounts. When you create a share, you are essentially creating a container that holds references to the data you want to make available to other parties.
Share objects refer to the database objects that can be included within a share. These include databases, schemas, tables, secure views, secure materialized views, and secure user-defined functions (UDFs). The provider account grants privileges on these objects to the share, which then makes them accessible to designated consumer accounts.
The key benefits of using shares include zero data movement, meaning consumers access the same underlying data stored in the provider's account. This ensures data is always current and eliminates storage costs for consumers. Additionally, providers maintain complete control over what data is shared and can revoke access at any time.
To create and manage shares, providers use SQL commands such as CREATE SHARE, GRANT privileges TO SHARE, and ALTER SHARE to add consumer accounts. Consumer accounts then create a database from the share using CREATE DATABASE FROM SHARE to access the shared data.
Secure views are particularly important in sharing scenarios because they prevent consumers from seeing the underlying table structures or data beyond what is explicitly shared. This adds an essential layer of security.
Shares support both direct sharing between accounts and listing on the Snowflake Marketplace, enabling broader data monetization opportunities. Reader accounts can also be created for organizations that do not have their own Snowflake account, expanding sharing possibilities to external parties.
Shares and Share Objects in Snowflake - Complete Guide
Why Shares and Share Objects Are Important
Shares and share objects are fundamental to Snowflake's Secure Data Sharing capability, which is one of Snowflake's most distinctive features. Understanding this concept is crucial for the SnowPro Core exam because it demonstrates Snowflake's unique architecture that enables sharing data across accounts with zero data movement or copying.
What Are Shares and Share Objects?
A Share is a Snowflake object that encapsulates all the information required to share data with one or more consumer accounts. It acts as a container that holds references to database objects (tables, views, UDFs) that you want to share.
Share Objects are the database objects that can be included in a share: - Tables - External tables - Secure views - Secure materialized views - Secure UDFs (User-Defined Functions)
Note: Only secure views, secure materialized views, and secure UDFs can be shared - regular views cannot be shared.
How Shares Work
1. Provider Account Creates a Share: The data provider creates a share object using CREATE SHARE command
2. Grant Privileges: The provider grants USAGE privilege on the database and schema, and SELECT privilege on specific objects
3. Add Consumer Accounts: The provider adds consumer account(s) to the share using ALTER SHARE
4. Consumer Creates Database from Share: The consumer creates a database from the share using CREATE DATABASE ... FROM SHARE
5. Zero-Copy Access: Consumers access the shared data in real-time through the underlying Snowflake services layer - no data is copied or transferred
Key Commands:
-- Create a share CREATE SHARE my_share;
-- Grant privileges GRANT USAGE ON DATABASE my_db TO SHARE my_share; GRANT USAGE ON SCHEMA my_db.my_schema TO SHARE my_share; GRANT SELECT ON TABLE my_db.my_schema.my_table TO SHARE my_share;
- Shares are read-only for consumers - Data remains in the provider's account (no data movement) - Consumers are charged only for compute resources used to query shared data - Storage costs remain with the provider - Shared data is always current (real-time access) - Works across regions and cloud platforms (with replication)
Share Types:
1. Direct Share: Shared with specific named accounts 2. Listing (Data Marketplace): Published to Snowflake Marketplace for broader distribution
Exam Tips: Answering Questions on Shares and Share Objects
Tip 1: Remember that only SECURE views can be shared. If a question mentions sharing a regular view, that option is incorrect.
Tip 2: Understand the billing model - the provider pays for storage, and the consumer pays for compute when querying shared data.
Tip 3: Know that shares work across different Snowflake accounts, and with replication enabled, can work across regions and cloud providers.
Tip 4: The ACCOUNTADMIN role is typically required to create shares and manage sharing relationships.
Tip 5: Remember that shared data appears as a read-only database in the consumer account - consumers cannot modify the underlying data.
Tip 6: Be familiar with the concept of zero-copy sharing - this is a key differentiator for Snowflake and frequently tested.
Tip 7: Know that you must grant privileges at each level: DATABASE → SCHEMA → OBJECT for the share to work properly.
Tip 8: Reader accounts (formerly called reader shares) allow sharing with non-Snowflake customers, where the provider pays for both storage and compute.
Common Exam Scenarios:
- Questions about what objects CAN or CANNOT be shared - Questions about who pays for storage vs compute - Questions about cross-region or cross-cloud sharing requirements - Questions about the privileges needed to create and manage shares - Questions distinguishing between shares and data replication