Skip to main content

πŸ“˜ Data Sharing in Snowflake:


βœ… What is Data Sharing in Snowflake?​

Data Sharing in Snowflake allows you to share live, read-only access to selected datasets without copying or duplicating the data. This means consumers can query your data directly in their Snowflake environment (or via a reader account), in real time, while you maintain full control.


βœ… Types of Data Sharing​

TypeDescription
Direct SharingShare data with another Snowflake account in the same region.
Reader AccountsShare with consumers who do not have a Snowflake account.
Cross-Region SharingShare data across regions within the same cloud provider.
Cross-Cloud SharingShare data across different cloud platforms (e.g., AWS to Azure).
Listing (Marketplace)Publicly share data or monetize it via the Snowflake Marketplace.

πŸš€ Why Use Data Sharing?​

βœ”οΈ Collaborate easily with partners, vendors, or other departments. βœ”οΈ Save on storage and ETL costs. βœ”οΈ Share data instantly without complex pipelines. βœ”οΈ Cross-cloud, cross-region supported via Snowgrid.


πŸ“‚ What Objects Can Be Shared?​

You can share read-only access to the following:

Object TypeCan Share?Notes
Databasesβœ…Consumers create databases from shares.
Schemasβœ…Consumers can query shared schemas.
Tablesβœ…Read-only access to tables.
Secure Viewsβœ…Only secure views are shareable (not standard views).
Secure UDFs/Functionsβœ…Only secure UDFs can be shared.
External Tables❌Cannot be shared.
Stages❌External/internal stages are not shareable.
File Formats❌File formats not shareable directly.
Tasks, Streams❌These are not shareable.

βœ… How Data Sharing Works in Snowflake​

Data sharing is based on metadata pointers, not data copies.

πŸ”§ Implementation Flow:​

  1. Create a Share

    CREATE SHARE healthcare_share;
  2. Add Objects to Share

    GRANT USAGE ON DATABASE healthcare TO SHARE healthcare_share;
    GRANT SELECT ON ALL TABLES IN SCHEMA healthcare.patients TO SHARE healthcare_share;
  3. Grant Access to Consumer Account

    ALTER SHARE healthcare_share ADD ACCOUNTS = ('account_locator');
  4. (Optional) Create Reader Account

    CREATE MANAGED ACCOUNT reader_acct ...;
  5. Consumer Mounts the Share

    CREATE DATABASE shared_data FROM SHARE provider_org.healthcare_share;

βœ… Components of a Share​

ComponentDescription
ShareA container holding database objects (tables, views, schemas).
ProviderThe Snowflake account that creates and shares the data.
ConsumerThe Snowflake account (or reader account) accessing the data.
Reader AccountA Snowflake-managed account created by the provider for consumers.

βœ… Advantages of Data Sharing​

BenefitDescription
No Data MovementAvoids ETL processes and storage duplication.
Live AccessConsumers access always-updated data.
Cost-EfficientConsumers pay for their compute; providers incur no compute cost.
Governed AccessFine-grained permissions and RBAC can be enforced on shared objects.
Secure & AuditableEncryption, access logs, masking, and row-level security apply.
High PerformanceUses Snowflake’s compute and storage layers directly, no external transfer.

βœ… Real-World Use Cases​

  • Healthcare: Hospitals share anonymized datasets with research partners securely.
  • Finance: Market data providers publish live stock feeds to brokers.
  • Retail: Vendors access real-time sales and inventory data from retailers.
  • Government: Agencies collaborate on census or policy data without duplication.

βœ… Roles & Privileges in Data Sharing​

RolePurpose
ACCOUNTADMINFull access to manage shares and reader accounts.
SECURITYADMINManages privileges and role assignments.
Custom RoleCan be granted share privileges with IMPORTED PRIVILEGES.

Key Privileges:​

PrivilegeDescription
USAGEGrants ability to use a database or schema.
SELECTGrants read access to tables and views.
IMPORTED PRIVILEGESAllows querying shared data from the consumer side.

🚦 Limitations and Important Notes​

❌ Read-only for Consumers

  • Consumers cannot modify shared data (no INSERT, UPDATE, DELETE).

❌ No Direct File/Stage Sharing

  • Stages, file formats, and external tables aren’t shareable.

❌ Secure Objects Only

  • Only secure views/UDFs can be shared.

❌ Data Location

  • Data physically stays in the provider’s Snowflake region.
  • Consumers in other regions still query live data, but cross-cloud/region latency might impact performance.

βœ… Security & Governance for Data Sharing​

Snowflake ensures secure sharing through:

  • End-to-End Encryption (TLS in transit, AES-256 at rest)
  • Access Control via RBAC
  • Dynamic Data Masking on shared views
  • Row-Level Security for personalized data sharing
  • Access History Logs for monitoring and auditing
  • Object Tagging and Data Classification

🏠 On-Premises Integration​

πŸ”Ή No direct sharing to on-prem databases (e.g., Oracle, SQL Server). πŸ”Ή On-premises users query shared data via a Snowflake consumer account using ODBC/JDBC/BI tools.


βœ… Best Practices for Data Sharing​

Best PracticeWhy It Matters
Use Secure ViewsAvoid exposing raw data; mask or filter sensitive columns.
Audit Usage RegularlyMonitor how shared data is being used or accessed.
Limit Object ExposureShare only necessary schemas/tables/views.
Use Tags for GovernanceHelps track sensitive/shared data assets.
Separate Share-Ready SchemasKeep shared objects isolated from raw/production schemas.
Create Reader Accounts for SimplicityEspecially useful for clients without Snowflake licenses.


Difference Between Views and Shares in Snowflake​

AspectViewsShares
DefinitionA view is a virtual table defined by a SQL query that runs on-demand when accessed. It does not store data physically but presents data from underlying tables or other views.A share is a Snowflake object that enables secure, controlled sharing of database objects (tables, views, schemas) between Snowflake accounts without copying the data.
PurposeUsed to simplify complex queries, abstract data, filter or transform data, and enforce security policies (e.g., hide sensitive columns via secure views).Used to share data securely with other Snowflake accounts or Reader Accounts, allowing those consumers to query live data without data duplication.
StorageViews do not store data; results are generated in real-time when queried (except materialized views which precompute and store).Shares do not store data independently; they provide access pointers to existing database objects owned by the provider account.
Security & ControlWith secure views, the view definition is hidden and sensitive data can be masked or restricted. They protect data visibility while controlling access.Shares enforce read-only access to data and prevent consumers from modifying or re-sharing data. Providers control what and who shares data with, including revoking access.
ScopeViews exist within a database and schema and serve as query abstractions or security layers on data in that environment.Shares operate at the database/schema level to expose multiple objects to external accounts, enabling cross-account data collaboration.
Use in SharingViews (especially secure views) are often included inside shares to expose a controlled subset of data safely.Shares are the vehicle to deliver access to data objects (tables, views) from provider to consumer accounts.

Additional Notes on Views:​

  • Regular (non-materialized) views run the underlying query each time they are accessed, offering real-time data but with some performance cost.
  • Materialized views store precomputed results for faster query responses but consume storage and maintenance resources.
  • Secure views add privacy by hiding the logic and applying masking or row-level security.

Summary​

  • Views are query-defined virtual tables used to abstract, filter, or secure data within a database.
  • Shares are data-sharing objects enabling controlled external access to databases and objects (including views) across Snowflake accounts, without moving or copying data physically.

βœ… Summary​

TopicSummary
WhatShare live, read-only data without copies
HowCreate share β†’ add objects β†’ grant access β†’ consumer mounts share
WhyCost savings, performance, real-time access, governance
SecurityRBAC, encryption, masking, audit logs
ComplianceSupports HIPAA, GDPR, SOC 2, and more
UsersBoth Snowflake and non-Snowflake consumers via Reader Accounts

βœ… Snowflake’s Data Sharing model transforms how businesses collaborate β€” removing friction, reducing cost, and improving agility without sacrificing control or security.