Databricks Delta Sharing

Companies often need to give data to partners, customers, or other departments. Sending copies by email or file transfer creates stale data and security risks. Delta Sharing is an open protocol that lets a provider share live tables securely, while recipients read the data with the tools they already use.

The Library Card Analogy

A library does not hand out copies of every book. Members receive a card, and the card lets them borrow what the library chooses to share. The library keeps the originals, tracks every loan, and cancels a card when needed. Delta Sharing works the same way for tables.

COPYING VS SHARING
──────────────────────────────────────────────────────────
COPY MODEL:
  Provider ──► export file ──► email or upload ──► Recipient
  Result: many stale copies that nobody tracks.

DELTA SHARING MODEL:
  Provider table ◄── secure read access ── Recipient
  Result: one live source with full access logs.

Key Terms

TermMeaning
ProviderThe organization that owns and shares the data
ShareA named collection of tables, views, or volumes to share
RecipientThe person or organization that receives access
Activation linkA one-time link that delivers credentials to an outside recipient

Two Sharing Styles

Databricks-to-Databricks Sharing

Both sides use Unity Catalog. The recipient mounts the share as a catalog and queries it like any other table. Permissions, lineage, and audit trails stay inside the platform.

Open Sharing

The recipient does not need Databricks. The provider generates a credential file, and the recipient reads the data from Python, Spark, pandas, Power BI, or other supported tools.

TWO SHARING PATHS
──────────────────────────────────────────────────────────
                    ┌──► Recipient with Databricks
Provider share ─────┤     (mounts share as a catalog)
                    │
                    └──► Recipient without Databricks
                          (uses a credential file and open connectors)

Create a Share

The steps below run as SQL commands in a notebook or in the SQL editor. The provider needs the right Unity Catalog privileges to create shares and recipients.

-- 1. Create a share
CREATE SHARE retail_partner_share;

-- 2. Add a table to the share
ALTER SHARE retail_partner_share ADD TABLE main.retail.gold_daily_sales;

-- 3. Create a recipient
CREATE RECIPIENT partner_company;

-- 4. Grant the recipient access
GRANT SELECT ON SHARE retail_partner_share TO RECIPIENT partner_company;
SHARING WORKFLOW
──────────────────────────────────────────────────────────
Create share ─► Add tables ─► Create recipient ─► Grant access
                                                       │
                           Recipient receives link and credentials

Read Shared Data

Recipient with Databricks

The recipient creates a catalog from the share and queries it with SQL.

CREATE CATALOG partner_data USING SHARE provider_name.retail_partner_share;

SELECT * FROM partner_data.retail.gold_daily_sales;

Recipient Using Python

An outside recipient installs the delta-sharing library and loads the table with the credential file.

import delta_sharing

profile = "/path/to/config.share"
table_url = profile + "#retail_partner_share.retail.gold_daily_sales"

df = delta_sharing.load_as_pandas(table_url)
print(df.head())

Control and Monitoring

  • Providers choose exactly which tables, columns, or partitions to share.
  • Providers revoke access at any time, and the recipient loses the data immediately.
  • Credential files can carry an expiry date.
  • Audit logs record every access to shared data.

Benefits Over File Transfers

ConcernFile TransferDelta Sharing
Data freshnessStale after exportLive access
CopiesManyNone extra
Access removalHard to enforceOne command
Usage trackingLimitedFull logs

Example: Supplier and Retailer

A beverage supplier wants to see daily shelf sales of its products in partner stores. A retail chain shares a gold sales table that includes only the supplier's product lines. The supplier connects through open sharing and loads the data into its own forecasting tool. The retailer revokes access when the contract ends.

SUPPLIER AND RETAILER
──────────────────────────────────────────────────────────
Retailer lakehouse
   gold_daily_sales (filtered to supplier products)
          │  Delta Sharing
          ▼
Supplier forecasting tool ──► production plan

Sharing Best Practices

  • Share gold-level tables that contain only approved information.
  • Remove personal data before sharing outside your company.
  • Create one recipient per partner so you can revoke access individually.
  • Review active shares and recipients on a regular schedule.

Key Points

  • Delta Sharing is an open protocol for secure, live data sharing.
  • Providers create shares and recipients, and they grant access with SQL.
  • Databricks-to-Databricks sharing keeps everything inside Unity Catalog.
  • Open sharing supports recipients that do not use Databricks.
  • Providers keep control, revoke access instantly, and see every access in logs.
  • Sharing live tables replaces stale file copies.