🎉 75% of content is free forever — Unlock Premium from $10/mo →
CW
NEWSLIVESearch All Content
đŸ’ŧ Servicesâ„šī¸ Aboutâœ‰ī¸ ContactView Pricing Plansfrom $10

Advanced Data Sharing in Snowflake

đŸŸĸ Free Lesson

Advanced Data Sharing in Snowflake

Snowflake's data sharing capabilities enable secure, real-time data exchange across organizations without data movement or copying.

Snowflake Data Sharing ArchitectureData Provider(Producer)Grant AccessSecure ShareObjectPublishShareSnowflakeMarketplacePrivate DataExchangeDiscoverAccessData ConsumerGovernanceLayerPolicyZero-copy | Zero-transfer | Single source of truth | Encrypted in transit and at rest

Architecture Diagram 2: Data Sharing Security Model

Data Sharing Security ModelProviderCREATE SHAREGRANT SELECTSecurity LayerNo data movementMetadata only sharedConsumerREAD-ONLY accessCannot re-shareGovernanceTracking activeUsage monitoredZero-copy | Zero-transfer | Single source of truth | Encrypted in transit and at rest

Data Sharing Models

Direct Sharing

Direct sharing allows providers to share data with specific consumers:

-- Create a share object
CREATE SHARE customer_share;

-- Grant usage on database objects
GRANT USAGE ON DATABASE analytics_db TO SHARE customer_share;
GRANT USAGE ON SCHEMA shared_schema TO SHARE customer_share;
GRANT SELECT ON TABLE customer_insights TO SHARE customer_share;

-- Add consumers to the share
ALTER SHARE customer_share ADD ACCOUNTS = ('consumer_account_1', 'consumer_account_2');

-- Consumers create database from share
CREATE DATABASE customer_data FROM SHARE provider_account.customer_share;

Reader Accounts

Reader accounts allow sharing with organizations that don't have Snowflake:

-- Create reader account for non-Snowflake consumers
CREATE READER ACCOUNT reader_org
  COMMENT = 'Reader account for external partner';

-- Share data with reader account
ALTER SHARE partner_share ADD ACCOUNTS = ('reader_account_id');

Data Marketplace

The Snowflake Marketplace provides a platform for sharing data products:

-- Browse marketplace listings
LISTING DIRECTORY SNOWFLAKE.MARKETPLACE;

-- Access marketplace data
CREATE DATABASE weather_data FROM SHARE weather_provider.weather_daily;

-- Query marketplace data
SELECT * FROM weather_data.weather.daily_forecast
WHERE location = 'New York'
  AND forecast_date >= CURRENT_DATE();

Creating Marketplace Listings

-- Create a listing for marketplace
CREATE OR REPLACE LISTING my_data_product
  TITLE = 'Industry Analytics Dataset'
  DESCRIPTION = 'Comprehensive industry analysis data'
  PUBLIC = TRUE
  BUSINESS_RADIUS = 'Region';

-- Grant access to listing
GRANT USAGE ON DATABASE my_db TO LISTING my_data_product;
GRANT USAGE ON SCHEMA my_schema TO LISTING my_data_product;

Private Data Exchange

Setting Up a Private Exchange

-- Create a private exchange
CREATE DATA EXCHANGE private_exchange
  COMMENT = 'Internal data exchange for business units';

-- Add accounts to exchange
ALTER DATA EXCHANGE private_exchange ADD ACCOUNTS = (
  'sales_account_id',
  'marketing_account_id',
  'finance_account_id'
);

-- Share data through exchange
CREATE SHARE cross_analytics_share;
GRANT USAGE ON DATABASE analytics_db TO SHARE cross_analytics_share;
ALTER DATA EXCHANGE private_exchange ADD SHARES = ('cross_analytics_share');

Exchange Governance

-- Monitor exchange activity
SELECT * FROM TABLE(INFORMATION_SCHEMA.SHARE_USAGE_HISTORY(
  START_TIME => DATEADD('day', -7, CURRENT_TIMESTAMP())
));

-- Review shared objects
SELECT * FROM INFORMATION_SCHEMA.SHARES
WHERE CREATED_ON >= DATEADD('day', -30, CURRENT_TIMESTAMP());

Advanced Sharing Patterns

Cross-Region Sharing

-- Enable cross-region sharing
ALTER ACCOUNT SET ENABLE_CROSS_REGION_DATA_SHARING = TRUE;

-- Share across regions
CREATE SHARE global_metrics_share;
ALTER SHARE global_metrics_share ADD ACCOUNTS = ('us_east_account', 'eu_west_account');

Data Sharing with Tag-Based Access Control

-- Tag objects for sharing policies
ALTER TABLE customer_data SET TAG sharing_policy = 'external_share';

-- Use tags in share creation
CREATE SHARE tagged_share;
GRANT USAGE ON DATABASE analytics_db TO SHARE tagged_share;
GRANT SELECT ON ALL TABLES IN SCHEMA shared_schema TO SHARE tagged_share
  WITH TAG (sharing_policy = 'external_share');

Dynamic Data Sharing

-- Share query results dynamically
CREATE SHARE dynamic_insights_share;
GRANT USAGE ON DATABASE analytics_db TO SHARE dynamic_insights_share;

-- Create shareable view with dynamic filtering
CREATE OR REPLACE SECURE VIEW shared_regional_data AS
SELECT *
FROM gold.sales_by_region
WHERE region = CURRENT_REGION();

GRANT SELECT ON VIEW shared_regional_data TO SHARE dynamic_insights_share;

Monitoring and Auditing

-- Monitor share usage
SELECT
  share_name,
  account_name,
  query_count,
  last_query_time
FROM TABLE(INFORMATION_SCHEMA.SHARE_USAGE_HISTORY(
  START_TIME => DATEADD('day', -30, CURRENT_TIMESTAMP())
));

-- Audit data access
SELECT
  query_id,
  query_text,
  user_name,
  start_time
FROM SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY
WHERE query_text LIKE '%FROM SHARE%'
  AND start_time >= DATEADD('day', -7, CURRENT_TIMESTAMP());

Best Practices

PracticeImplementationBenefit
Use Secure ViewsCreate SECURE VIEW objectsPrevent metadata leakage
Implement Tag-Based PoliciesApply tags to shared objectsCentralized governance
Monitor UsageQuery SHARE_USAGE_HISTORYOptimize sharing patterns
Version ControlTrack share changesMaintain data lineage
Access ReviewsRegular share auditsSecurity compliance

Summary

Key Takeaways

Direct sharing enables real-time, zero-copy data access without data movement between accounts.

Reader accounts extend sharing to non-Snowflake users, enabling broader data distribution.

Marketplace provides a platform for data monetization and discovery across organizations.

Private exchanges support governed multi-party data sharing within your organization.

Cross-region sharing enables global data distribution while maintaining data residency requirements.


Best Practices for Data Sharing

  1. Use Secure Views to prevent metadata leakage
  2. Implement Tag-Based Policies for centralized governance
  3. Monitor Usage via SHARE_USAGE_HISTORY to optimize patterns
  4. Track share changes for data lineage
  5. Conduct regular share audits for security compliance

See Also

  • Data Sharing — Secure, zero-copy data exchange across organizations
  • Data Lakehouse — Combining data lake flexibility with warehouse performance
  • Access Control — Role-based access control and security policies
  • Governance — Data governance frameworks including compliance and policies
CW

ChatWhole Learn Editorial Team

Written by experienced data scientists, software engineers, and educators. All content is reviewed by industry professionals to ensure accuracy and relevance.

Last reviewed: 2026-09-18

—
☆☆☆☆☆
0 ratings

Rate & Feedback

Need Expert Snowflake Help?

Get personalized tutoring, project support, or professional consulting.

Advertisement