In this lesson, you will learn how to configure secure, zero-copy data sharing to expose your internal analytical tables to third-party stakeholders without the risks associated with traditional ETL exports.
Moving Beyond Flat File Exports
Traditionally, sharing data with external partners involved exporting datasets to CSVs or Parquet files, moving them to an intermediate bucket, and managing access credentials. This approach creates security risks, stale data, and "data sprawl." Modern cloud data platforms solve this through secure data sharing, which allows you to grant external partners access to live database objects without physically moving or copying the data.
Configuring Secure Sharing
The core of this architecture is the "Provider-Consumer" model. As a provider, you create a dedicated object (often called a SHARE or DATA EXCHANGE) that acts as a secure pointer to your internal analytical tables or views.
To ensure your data remains secure while exposed to stakeholders, follow this configuration pattern:
- Grant Access to the Container: Create a secure share object.
- Assign Objects: Add specific tables or materialized views to that share.
- Implement Row-Level Security (RLS): Before adding the table to the share, apply an RLS policy. This ensures that when a third party queries the table, they only see rows authorized for their specific organization.
- Grant Permissions: Grant usage rights on the database and schema, and select rights on the specific objects within the share.
-- Create a secure share
CREATE SHARE partner_analytics_share;
-- Grant usage on the specific analytical schema
GRANT USAGE ON DATABASE sales_db TO SHARE partner_analytics_share;
GRANT USAGE ON SCHEMA sales_db.analytics TO SHARE partner_analytics_share;
-- Grant select on the view (which should have RLS applied)
GRANT SELECT ON VIEW sales_db.analytics.regional_performance_report
TO SHARE partner_analytics_share;
Why This Matters for Analytics
By leveraging this direct metadata-sharing approach, your stakeholders always see the most recent data (fulfilling the "Data Freshness" requirements discussed in earlier lessons). Because you are not moving data, you maintain strict control over the lifecycle of the information and simplify your audit trail, as all access is logged within the source platform.
Key Takeaway: Secure data sharing enables you to expose analytical insights in real-time by granting controlled, read-only access to specific database objects, eliminating the need for insecure file transfers or redundant data copies.