What is Data Sharing in Snowflake: Simple Explanation and Example
Snowflake allows you to securely share live data with other Snowflake accounts without copying or moving it. It works by creating a share object that grants access to specific database objects, enabling real-time collaboration.How It Works
Imagine you have a library of books (your data) and you want to let your friends read some of them without giving them the books to keep. In Snowflake, data sharing works like lending access to your library without handing over copies. You create a share that points to specific data tables or views you want to share.
The friends (other Snowflake accounts) can then see and query this data live, directly from your library, without needing to copy or move it. This means the data is always up-to-date and secure because you control exactly what is shared and who can see it.
Example
This example shows how to create a share, add a table to it, and grant access to another Snowflake account.
CREATE SHARE my_share; GRANT USAGE ON DATABASE my_database TO SHARE my_share; GRANT SELECT ON TABLE my_database.public.my_table TO SHARE my_share; ALTER SHARE my_share ADD ACCOUNTS = ('123456789012');
When to Use
Use data sharing in Snowflake when you want to share live data securely and efficiently without copying it. It is ideal for:
- Sharing data with partners or customers in real time.
- Collaborating across departments or teams within your organization.
- Providing data access to external analysts or vendors without data duplication.
This saves storage costs and ensures everyone works with the latest data.
Key Points
- Data sharing does not copy data; it shares live access.
- You control what data and which accounts can access it.
- Shared data is always current and secure.
- Works only between Snowflake accounts.
