Delta Sharing Overview

Earn 25 points (50 with Pro) in two steps

  1. ① Read through the lesson — each section gets a ✓ as you scroll through it.
  2. ② When every section has a ✓, tap Complete lesson.

0 of 10 read · keep scrolling

✦ See fewer ads and earn double points — 50 a lesson instead of 25 — with Pro

Delta Sharing: An In-Depth Guide to Secure Data Exchange

Introduction: The Challenge of Modern Data Sharing

In the modern enterprise, data is rarely confined to a single environment. Organizations frequently need to share information across different business units, with external partners, or across various cloud regions to drive collaborative insights. Historically, this has been a painful process involving the creation of "data dumps," manual file transfers, or the maintenance of complex, expensive replication pipelines. These methods are not only slow and prone to human error, but they also create significant security and compliance risks by duplicating sensitive information across multiple storage locations.

Delta Sharing represents a fundamental shift in how we approach this problem. It is an open-source protocol that allows for the secure exchange of data across diverse computing environments without the need to replicate or move the underlying files. By leveraging the Delta Lake format, Delta Sharing provides a way to grant access to live data tables while maintaining strict governance and control. As part of the Unity Catalog ecosystem, it ensures that you know exactly who is accessing your data and provides the tools to audit that access effectively. Understanding Delta Sharing is critical for any data professional tasked with managing secure, scalable data architectures in a multi-cloud or multi-workspace environment.


Not read yet

What is Delta Sharing?

At its core, Delta Sharing is an open protocol that enables the secure exchange of data between different entities. Unlike traditional sharing methods that require the recipient to have access to your specific cloud storage account or database instance, Delta Sharing acts as a bridge. It leverages the structure of Delta Lake—a storage layer that brings reliability and performance to data lakes—to serve data directly to the consumer.

The protocol is designed to be platform-agnostic. Because it is open source, it allows organizations to share data with partners who may not be using the same cloud provider or even the same data processing platform. This capability is essential for organizations that operate in hybrid-cloud or multi-cloud settings, where moving data between providers like AWS, Azure, and Google Cloud Platform is often hindered by egress costs and technical incompatibilities.

How it Works: The Architecture

Delta Sharing operates through a client-server model. The Data Provider (the organization sharing the data) sets up a sharing server. In the context of Unity Catalog, this server is managed by the platform itself, simplifying the overhead significantly. The Data Recipient uses a client—which could be a Spark-based application, a BI tool, or a custom Python script—to request the data.

  1. Authentication: The recipient is provided with a unique credential file (a JSON file containing a token).
  2. Authorization: The provider defines a "Share" in Unity Catalog, which acts as a container for specific tables or partitions.
  3. Data Access: When the client requests data, the server validates the token and provides a set of pre-signed URLs. These URLs allow the client to read the underlying Parquet files directly from the cloud storage without passing through the server itself, ensuring high performance.

Callout: Delta Sharing vs. Traditional Replication Traditional data sharing often involves copying data from your production environment to a public bucket or a partner's storage account. This creates a "data drift" problem where the recipient is looking at stale information. Delta Sharing, by contrast, provides a direct view into the source tables. If you update the data in your Delta table, the recipient sees the update immediately upon their next query. This eliminates the need for manual synchronization and reduces the storage footprint significantly.


Not read yet

Implementing Delta Sharing in Unity Catalog

Implementing Delta Sharing within Unity Catalog is a structured process that moves from defining the share to managing the recipients. Unity Catalog centralizes this governance, allowing you to manage sharing permissions alongside your internal data access policies.

Step 1: Create a Share

A "Share" is a logical grouping of tables that you intend to share with one or more recipients. You can include entire tables, specific columns, or even filtered rows (using row-level filters) to ensure the recipient only sees what they are authorized to view.

-- Create a share named 'marketing_data_share'
CREATE SHARE marketing_data_share;

-- Add a table to the share
ALTER SHARE marketing_data_share 
ADD TABLE main.sales.customer_transactions;

-- Add another table with a row filter
ALTER SHARE marketing_data_share 
ADD TABLE main.sales.regional_data 
WHERE region = 'North_America';

Step 2: Define the Recipient

A "Recipient" represents the external entity or business unit that will consume the data. In Unity Catalog, you create a recipient object and associate it with a unique token.

-- Create a recipient
CREATE RECIPIENT external_partner_corp;

-- Grant the recipient access to the share
GRANT SELECT ON SHARE marketing_data_share TO RECIPIENT external_partner_corp;

Step 3: Generating and Distributing the Activation Link

Once the recipient is defined, the system generates an activation link. You send this link to the recipient, who then uses it to download their credential file. This file contains the authentication token necessary to access the shared data.

Note: The activation link is time-sensitive and should be shared through secure channels. Once the recipient downloads their credential file, the link is no longer valid, which prevents unauthorized parties from intercepting the link and gaining access.


Not read yet

Practical Examples of Delta Sharing

Scenario A: Sharing Data with a Third-Party Analytics Firm

Imagine your company works with a third-party analytics firm that needs to perform trend analysis on your transaction data. You do not want to give them access to your entire data lake, nor do you want to manage individual file permissions in your cloud storage.

By using Delta Sharing, you create a share that includes only the transactions table. You can even restrict the columns to exclude PII (Personally Identifiable Information) by creating a "View" and sharing the view instead of the base table. The analytics firm simply uses the Delta Sharing connector in their own environment (e.g., a local Python environment or their own Databricks workspace) to pull the data.

Scenario B: Sharing Across Business Units

In a large organization, the "Finance" department might own data that the "Logistics" department needs to optimize shipping routes. Instead of Finance moving files to a shared "Logistics" bucket—which creates security risks and audit gaps—Finance sets up a Delta Share. Logistics accesses the data as if it were a local table. This provides a unified governance model where Finance maintains control over the data, while Logistics gains the agility to use it immediately.


Not read yet

Best Practices for Secure Data Sharing

Security is the primary driver for using Delta Sharing. However, simply using the tool is not enough; you must implement it with a "least privilege" mindset.

1. Granular Access Control

Never share an entire database if you only need to share a specific table. Use the WHERE clause in your ALTER SHARE statement to filter rows, and use SQL views to filter columns. This ensures that the recipient only accesses the minimum amount of data required for their task.

2. Regular Auditing

Unity Catalog logs all access requests made through Delta Sharing. You should regularly review these logs to ensure that recipients are only accessing data during expected timeframes and that no unusual patterns (such as bulk downloading of data that should be queried incrementally) are occurring.

3. Credential Lifecycle Management

Treat the credential files as you would any other sensitive password. If a partner employee leaves their firm, or if the contract expires, you should immediately revoke the recipient access in Unity Catalog.

-- Revoke access when the contract expires
REVOKE SELECT ON SHARE marketing_data_share FROM RECIPIENT external_partner_corp;

4. Use Versioning and Time Travel

Since Delta Sharing is built on Delta Lake, you can share specific versions of your data if needed. This is useful for reproducibility, where a partner needs to run an analysis against a specific snapshot of your data from last month.


Not read yet

Common Pitfalls and How to Avoid Them

Even with a robust tool like Delta Sharing, there are common mistakes that can lead to security vulnerabilities or performance bottlenecks.

Mistake 1: Over-Sharing Data

A common error is to share a table that contains sensitive columns (like email addresses or phone numbers) because the provider forgot to mask them.

  • The Fix: Always create a specific view for sharing. For example: CREATE VIEW shared_sales AS SELECT id, amount, date FROM raw_sales;. Share this view instead of the base table.

Mistake 2: Ignoring Egress Costs

While Delta Sharing is efficient, it still involves moving data over the network. If your recipient is in a different cloud region, the data transfer might incur egress costs from your cloud provider.

  • The Fix: Be mindful of the geographic location of your recipients. If you have many recipients in a specific region, consider if there are ways to optimize the data layout to minimize the number of files accessed during a query.

Mistake 3: Improper Credential Storage

Recipients sometimes store their credential JSON files in insecure locations, such as public code repositories (e.g., GitHub).

  • The Fix: Educate your partners on the importance of keeping these files in secure secret management systems (like Azure Key Vault, AWS Secrets Manager, or HashiCorp Vault) rather than hardcoding them or saving them to shared drives.

Not read yet

Comparison: Sharing Methods

Feature Delta Sharing Manual File Transfer (CSV/Parquet) Database Replication
Data Freshness Real-time Stale (Snapshot) Lag-dependent
Security Centralized (Unity Catalog) Manual/Fragmented Database-level
Governance Full Audit Trail None/Limited Proprietary
Egress Costs Optimized High (Full copies) High (Full copies)
Format Support Delta Lake (Open) CSV/Parquet Proprietary

Callout: Why Delta Sharing is "Future-Proof" The industry is moving toward "Data Mesh" and decentralized data architectures. In these models, data products are managed by the teams that produce them. Delta Sharing is the perfect technical enabler for this shift because it allows teams to expose their data products without requiring a centralized, monolithic data warehouse to ingest and store everything.


Technical Deep Dive: The Client Experience

It is helpful to understand what happens on the recipient's side. When a data scientist at a partner company wants to access your shared data, they don't need a Databricks account. They can use the delta-sharing Python library.

Example: Consuming Shared Data in Python

The recipient will install the library and use the credential file you provided:

import delta_sharing

# The path to the credential file provided by the data owner
credential_file = "path/to/my_token.json"

# Create a client
client = delta_sharing.SharingClient(credential_file)

# List available shares
shares = client.list_shares()

# Access a specific table
table_url = "share_name.schema_name.table_name"
df = delta_sharing.load_as_pandas(table_url)

# Perform analysis
print(df.head())

This simple interface hides the complexity of authentication, token refreshing, and the fetching of pre-signed URLs. It makes the experience of "external" data feel exactly like reading a local file.


Not read yet

Advanced Governance: Row and Column-Level Security

In enterprise environments, you often need to share data with multiple parties, but each party should only see their own data. For example, a retail company might share sales data with regional managers. Instead of creating a separate share for every single manager, you can use Row-Level Security (RLS) in Unity Catalog.

When you define the share, you can apply a filter that is dynamically evaluated based on the identity of the recipient. While the implementation specifics can vary based on your Unity Catalog configuration, the concept is that the WHERE clause in your share definition acts as a gatekeeper.

Column Masking

Similarly, you can use column masking to ensure that sensitive data is hidden. If you are sharing a user table, you might want to mask the ssn column so that it appears as ***-**-**** to the recipient, while remaining intact for your internal processes. This is configured in the Unity Catalog interface or via SQL:

ALTER TABLE main.sales.customer_data 
ALTER COLUMN ssn SET MASK ssn_mask_function;

When you add this table to a share, the mask is automatically applied to any recipient querying the data. This provides a consistent security posture regardless of whether the query is internal or external.


Not read yet

Troubleshooting Common Issues

Even with a smooth setup, you may encounter issues. Here is how to handle them:

  1. "Access Denied" Errors: This is almost always a permissions issue. Check that the recipient user has the SELECT privilege on the share and that the underlying storage credentials for the table are correctly configured in Unity Catalog.
  2. Slow Query Performance: If the query is slow, check the number of files in the Delta table. If the table has not been "optimized" (via OPTIMIZE command), the reader might be scanning thousands of small files. Use OPTIMIZE to compact the table before sharing.
  3. Connectivity Issues: Since Delta Sharing uses HTTPS to fetch data, ensure that the recipient's network allows connections to the cloud storage endpoints where the files reside. Sometimes, corporate firewalls block access to specific S3 or Azure Blob storage domains.

Best Practices Summary

  • Always use Versioning: Document the version of the data you are sharing so the recipient knows exactly what they are analyzing.
  • Monitor Usage: Use the Unity Catalog audit logs to keep track of who is accessing what and when.
  • Minimize Scope: Share only the specific tables or views required. Use row and column filters to minimize the blast radius of any potential data leak.
  • Automate Lifecycle: Use infrastructure-as-code (like Terraform) to manage the creation of shares and recipients, reducing the risk of manual configuration drift.
  • Educate Recipients: Provide clear documentation to your partners on how to use the Delta Sharing client, including security best practices for their credential files.

Not read yet

Key Takeaways

  1. Direct Data Access: Delta Sharing allows you to share live, up-to-date data without creating copies or moving files, which significantly reduces storage costs and data synchronization issues.
  2. Unity Catalog Integration: By managing shares within Unity Catalog, you gain a unified governance layer that covers internal access, external sharing, and audit logging in one place.
  3. Security-First Design: The protocol supports granular security features like row-level filtering and column masking, ensuring that recipients only see the data they are strictly authorized to view.
  4. Open Protocol: Because Delta Sharing is an open protocol, it avoids vendor lock-in, allowing your organization to share data across different clouds and platforms seamlessly.
  5. Performance and Scalability: By leveraging pre-signed URLs to fetch data directly from storage, Delta Sharing provides high-performance access without bottlenecking your sharing server.
  6. Operational Efficiency: Automating the creation and management of shares reduces the administrative burden on data teams, allowing them to focus on delivering value rather than managing file transfers.
  7. Compliance and Auditability: With centralized logging in Unity Catalog, you can easily prove to auditors who accessed your data, when they accessed it, and what filters were applied, which is essential for regulated industries.

By mastering Delta Sharing, you move your organization away from the fragile, insecure methods of the past and toward a modern, governed, and highly efficient data ecosystem. This is not just a technical improvement; it is a fundamental pillar of a mature data strategy.

Not read yet

Each section gets a ✓ as you scroll through it. Tap the button to jump to the next one.