intermediate⏱50Lesson 18 of 19

Domain 5.2 β€” Secure Data Sharing and Data Clean Rooms

Understand Snowflake's Secure Data Sharing model β€” provider/consumer/reader accounts, direct shares, and privacy-preserving collaboration with data clean rooms.

Domain 5.2 β€” Secure Data Sharing and Data Clean Rooms

ℹ️Note

Exam Domain 5.2 β€” Secure Data Sharing contributes to the Data Collaboration domain, which is 10% of the COF-C03 exam.


Overview: How Sharing Works

Snowflake Secure Data Sharing lets a provider share live, read-only data with a consumer β€” no data is copied, no ETL is required.

100%

Key characteristics:

  • Zero data copy β€” consumer reads directly from provider's storage.
  • Always live β€” consumers see inserts/updates in real time.
  • Read-only β€” consumers cannot modify shared data.
  • Cross-cloud/cross-region requires replication (covered in Lesson 17).

1. Secure Shares

Creating and Managing a Share

sql
-- Create a share CREATE SHARE sales_share; -- Grant usage on the database and schema GRANT USAGE ON DATABASE prod_db TO SHARE sales_share; GRANT USAGE ON SCHEMA prod_db.public TO SHARE sales_share; -- Grant access to specific objects GRANT SELECT ON TABLE prod_db.public.orders TO SHARE sales_share; GRANT SELECT ON VIEW prod_db.public.orders_summary TO SHARE sales_share; -- Add a consumer account ALTER SHARE sales_share ADD ACCOUNTS = org1.consumer_account; -- Remove a consumer ALTER SHARE sales_share REMOVE ACCOUNTS = org1.consumer_account; -- See current shares SHOW SHARES;

Consumer: Mounting a Share

sql
-- Consumer creates a local database from the inbound share CREATE DATABASE shared_sales FROM SHARE provider_org.sales_share; -- Query like any other table (read-only) SELECT * FROM shared_sales.public.orders;

What Can Be Shared?

ObjectShareable?
Tablesβœ…
External tablesβœ…
Secure viewsβœ…
Secure materialized viewsβœ…
UDFs (secure)βœ…
Regular (non-secure) views❌
Stages, pipes, streams❌
⚠️Warning

Only SECURE views and functions can be added to a share. A regular view exposes the underlying query definition, which is a privacy risk for providers.


2. Secure Views

A Secure View hides the view definition from the consumer. Without the SECURE keyword, a consumer could infer the provider's data model.

sql
-- Regular view β€” definition is visible to consumers CREATE VIEW orders_summary AS SELECT region, SUM(amount) FROM orders GROUP BY region; -- Secure view β€” definition is hidden CREATE SECURE VIEW orders_summary AS SELECT region, SUM(amount) FROM orders GROUP BY region;
ℹ️Note

Secure views disable certain query optimizer shortcuts. This can make them slightly slower than equivalent regular views. Use SECURE only when the view will be shared or where definition privacy is required.


3. Reader Accounts

A Reader Account allows providers to share data with customers who do not have a Snowflake account. The provider creates and manages the reader account.

100%
sql
-- Create a reader account (managed account) CREATE MANAGED ACCOUNT my_reader_account ADMIN_NAME = 'reader_admin' ADMIN_PASSWORD = 'SecurePass123!' TYPE = READER; -- Add the reader account to a share ALTER SHARE sales_share ADD ACCOUNTS = my_reader_account;

Key facts about reader accounts:

  • Provider pays all compute costs for the reader account.
  • Reader accounts are fully managed by the provider.
  • They can only access data from the provider that created them.
  • Reader accounts cannot create shares of their own.

4. Data Sharing Roles and the Provider/Consumer Model

100%

5. Cross-Cloud and Cross-Region Sharing

Direct sharing works between accounts on the same cloud + region without additional configuration. Cross-cloud or cross-region sharing requires a replication step.

100%

6. Data Clean Rooms

A Data Clean Room is a privacy-preserving environment where two or more parties can run joint analyses on combined datasets without either party seeing the other's raw data.

How Snowflake Clean Rooms Work

100%

Key privacy guarantees:

  • Neither party can see the other's individual-level records.
  • Analysts receive only aggregate or statistical results.
  • Row-level policies and differential privacy controls limit result precision.
  • Built on Snowflake's standard RBAC + Row Access Policies.

Use Cases

IndustryUse Case
AdvertisingAudience overlap analysis between advertiser and publisher
Financial servicesFraud detection across institutions
HealthcareMulti-hospital research without exposing patient records
RetailSupply chain partner data collaboration
ℹ️Note

Snowflake's native Clean Room capability is built on the Native App Framework and secure sharing. On the exam, remember that clean rooms enforce privacy through aggregation thresholds and secure views, not encryption of query inputs.


7. Listing Data on the Marketplace vs. Direct Share

100%
Secure Share (Direct)Marketplace Listing
AudienceSpecific known accountsAny Snowflake customer
DiscoveryPrivatePublic (or private listing)
ApprovalAutomaticProvider can require approval
MonetisationNot built-inVia Snowflake billing integration
Use caseB2B partnershipsData products, SaaS datasets

Summary

βœ…Success

Key Takeaways for the Exam

  • Sharing is zero-copy and live β€” no ETL, no data movement.
  • Consumers get read-only access; they cannot write to shared objects.
  • Only SECURE views and secure UDFs can be added to shares.
  • Reader Accounts: for non-Snowflake consumers; provider pays compute.
  • Cross-cloud/cross-region sharing requires replication first.
  • Data Clean Rooms enable joint analysis without exposing raw records β€” results are aggregate only.

Practice Questions

1. A provider adds a regular (non-secure) view to a share. What happens?

  • A) It succeeds β€” all views can be shared
  • B) It fails β€” only SECURE views can be added to shares βœ…
  • C) The view is automatically converted to a secure view
  • D) Consumers see the data but not the definition

2. A consumer mounts a provider's share. 10 minutes later the provider inserts new rows. When does the consumer see the new rows?

  • A) After the next scheduled refresh (daily)
  • B) After the consumer re-runs CREATE DATABASE FROM SHARE
  • C) Immediately β€” sharing is live and zero-copy βœ…
  • D) After the provider runs ALTER SHARE REFRESH

3. Which account type allows a provider to share data with a customer who has no Snowflake account?

  • A) Secondary account
  • B) Managed account
  • C) Reader account βœ…
  • D) Business Critical account

4. Who pays for the compute costs in a Reader Account?

  • A) The reader/consumer
  • B) Snowflake automatically
  • C) The provider βœ…
  • D) Split 50/50 between provider and consumer

5. Provider is on AWS us-east-1. Consumer is on Azure eastus. Can the provider share directly?

  • A) Yes β€” sharing works across all clouds natively
  • B) No β€” cross-cloud sharing requires database replication first βœ…
  • C) No β€” cross-cloud sharing is not supported at all
  • D) Yes, but only for Enterprise edition providers

6. In a Data Clean Room, why can neither party see the other's raw data?

  • A) Data is encrypted with different keys
  • B) Results are routed through a third-party broker
  • C) Aggregation thresholds and secure views restrict output to aggregate results βœ…
  • D) Individual rows are hashed before being shared

7. Which Snowflake object types can be included in a share? (Select all that apply)

  • A) Tables βœ…
  • B) Secure views βœ…
  • C) Stages
  • D) External tables βœ…
  • E) Streams
Progress95%