Multi-tenant SaaS platforms collect analytics on behalf of their customers. When those customers want the data itself, they want it in Power BI, Spark, Databricks, or ODBC/JDBC. This is never a part of any scheduled export.
If the tenant count is two or three, then it is a Delta Share and a minor configuration job can complete the task. But when the tenant number hits 100 whose reporting involves more than 100,000 partner organizations, then it becomes a platform problem. The problem encompasses tenant isolation, PII that can’t go gold unmasked, automated onboarding, incremental refresh cost, a versioned data contract, and egress that can be attributed to a recipient.
We solved one such problem. In this blog, I am about to discuss how we implemented that on Databricks. I built the solution on Unity Catalog, materialized views, and Delta Sharing, with three Jobs driven by a governance mapping table.

Unlike Delivery, Gold Is Multi-Tenant
Gold is a single multi-tenant layer. Facts and dimensions carry tenant_id. All tenants share the same pipeline definition and onboarding a new tenant does not require a new bronze/silver path. Unity Catalog limits internal analysts and jobs to the tenants they are entitled to see for row-level security on gold.
That model works for internal analytics.” This is NOT the object to share externally. All the gold tenants’ rows live in one table physically. Then isolation is based on some filter that evaluates correctly on every consumer query. We don’t share gold.
What we have in common is a per tenant schema of materialized views within a mart catalog. Isolation is where the bytes live: mart_v1.tn1 has only tenant 1. A query against it can never return rows for tenant 2, because those rows were never written there. Catalog, Schema, Share, Recipient, and Unity Catalog objects are used as follows.
| Object | Role |
| Gold (internal catalog) | Combined analytics. RLS for internal use. Not in any external share. |
| mart_v1 | Mart version 1 catalog (environment suffix on v1). One schema per tenant. |
| mart_v2, mart_vN | Later mart versions. Same pattern. Created only for breaking contract changes. Same S3 location as mart_v1. |
| Share (one per tenant) | Lists that tenant’s schema from every mart version currently in force. |
| Recipient (one or more per tenant) | Granted the tenant’s share. Default is one recipient; additional recipients are for test or another unit. |
| governance.recipient_tenant_map | System of record: tenant, share name, recipients, active flag. |
Illustrative layout:
gold -- internal, all tenants, RLS
mart_v1 -- catalog; dedicated S3
├── tn1 -- schema: tenant 1 MVs only
├── tn2
└── tnN
mart_v2 -- catalog; same S3 as mart_v1
├── tn1
├── tn2
└── tnN
share_tn1
├── mart_v1.tn1
└── mart_v2.tn1 -- added when v2 is provisioned
recipients: r1 [, r2 for test / another unit]
mart_v2 is not a nightly by-product. The catalog is created manually (same storage root as mart_v1), then Provision_mart creates per-tenant schemas and updates shares. Currently on mart version, changes are additive and non-breaking. The contract breaks existing consumers, only then does a new catalog exist.
All mart versions share the same S3 path, so Data Sharing storage and egress are one bucket. Versioned prefixes do not share costs. By construction, Delta Sharing activity is an activity against that bucket. recipient_id in those events links to governance.tenant (and recipient) attribution: recipient_tenant_map.
Materialized Views Are the External Contract
PII is masked in the MV definition. The shared object never holds the raw column.
CREATE OR REFRESH MATERIALIZED VIEW mart_v1.tn1.fact_engagement AS
SELECT
event_date,
campaign_id,
content_id,
partner_id,
sha2(partner_email, 256) AS partner_email_hash,
engagement_score
FROM gold.fact_engagement
WHERE tenant_id = 'tn1';
The MV is the contract: filtered to one tenant, masked to the agreed external schema. There is no unmasked column sitting behind a grant that could be attached to the share by mistake.
Governance Table
Jobs do not scan catalogs to decide who is live. They read governance.recipient_tenant_map.
That table is the control plane for sharing:
- tenant identifier
- share object name (one share per tenant)
- recipient metadata
- active flag
Refresh and provision jobs process active tenants only. Deactivating a row stops MV refreshing and stops new-mart schema creation for that tenant without dropping historical objects by accident.
Job: Refresh MV
Parameters (all optional):
| Parameter | If omitted | If set |
| mart_version | Refresh all mart catalogs for in-scope tenants | Refresh that mart only (mart_v1, mart_v2, …) |
| tenant_id | All active tenants in recipient_tenant_map | That tenant only (must be active) |
Behaviour:
1. Work out the set of tenants: recipient_tenant_map where active (and tenant_id if passed).
2. Fix mart catalogs (all or mart_version).
3. Check for each tenant–mart pair whether its gold slice has been modified since the last successful refresh.
4. Refresh only the tenant-table combinations (delta). Do not transform unchanged slices.
This is the job scheduled. Cost is based on volume of change, not tenant count. If a definition cannot be incrementally refreshed or if most of the tenant’s source has changed, a full refresh of that MV is still valid; the job is allowed to choose.

Job: Tenant Onboarding
Onboarding a tenant is one Job, not a runbook.
1. Create the share object for that tenant (empty of other tenants’ schemas).
2. Insert / update governance.recipient_tenant_map with the tenant, the share name, and active = true.
3. Create the tenant schema on every existing mart catalog (mart_v1, mart_v2, … if already present).
4. Create the recipient, set properties, grant the tenant’s share, generate the activation URL, and send it via AWS SES.
5. Run Refresh MV with tenant_id (and optionally mart_version) so the new schemas are populated.
The same Job can add an additional recipient to an existing share (test vs production, or a second unit). The share stays the same. A new recipient is added. The credentials are the receiver’s. Recipients remain unchanged. share profile later when a new mart schema is added to share.

Job: Provision_mart
A new mart version is a breaking contract. Catalog creation is manual: create mart_v2 (or mart_vN) with the same S3 location as mart_v1. Then Provision_mart does the tenant fan-out.
1. Read active share objects from governance.recipient_tenant_map.
2. For each active tenant, create the tenant schema in the new mart catalog.
3. Update each tenant’s share to include the new schema (mart_v2.tn1 on share_tn1, and so on). Recipients do not change; the new schema appears on the existing credential.
4. Run Refresh MV with those tenants and the new mart_version.

During dual run, a recipient lists both mart_v1.tnN and mart_v2.tnN. The tenant migrates dashboards on their timeline. Additive changes never take this path; they ship in place on the current mart.
What This Architecture Enables
- Physical isolation — per-tenant schemas of MVs; gold is never shared.
- Share as the tenant boundary — one share per tenant, multiple recipients if needed, multiple mart versions on the same share.
- PII at write time — masking in the MV definition.
- Governance-driven Jobs — active rows in recipient_tenant_map are the only tenants Refresh MV and Provision_mart process.
- Delta refresh — optional tenant_id / mart_version; skip unchanged slices.
- Stable credentials — new mart schemas attach to existing shares and recipients.
- *Single S3 root for all `mart_v** — one place to measure sharing storage and egress, attributed via recipient_id` → tenant map.
At 100 tenants, adding the 101st is an onboarding Job plus a Refresh MV for that tenant_id. Adding mart_v2 is a manual catalog on the same S3 path, then Provision_mart.