Unity Catalog - Architecture Patterns
Unity Catalog - Architecture Patterns
Architecture Patterns
Bernhard Walter
2023-09-28
©2023 Databricks Inc. — All rights reserved 1
Table of Contents
Patterns
catalogs
DEV PRD
○ Isolate admin scope by delegating administration of assigned
Workspace Workspace
assigned
managed managed
the catalogs to different admins for DEV, STG, PRD container/ container/
bucket Work Work bucket
● Catalog names can be combinations of SDLC and business / load load
organizational unit names, e.g. sales_dev, sales_prd,
engineering_dev read/write via read/write via
<DA> token <PA> token
● Access to workspaces, clusters and endpoints needs to be
configured accordingly
DEV bucket/ Delta PRD bucket/
container container
As a best practice, use at minimum 2 workspaces Grant access to <DA>
Lake Grant access to <PA>
(others/prod), but ideally 3 workspaces (dev/stg/prod) *
<DA> DEV System Account for UC <JA> System Account to execute jobs in PRD
<PA> PRD System Account for UC <UG> User Group working in DEV and Prod
• Users in region 1 can then access the shared data from region $ $
2 via metastore 1
delta
connection
In both cases Share 1 sharing
authn
authn
• region 1 can additionally control access for their users on top meta WS 2
in metastore 1 store 2 2 Cluster or SQl warehouse
• egress costs arise from data leaving region 2 (region 1 Data flow
reading) read/write
Object Store Access Control by
/ UC / Workspace
Note: We strongly do not recommend registering common tables as Cloud region 2 (provider) $
Egress cost from one
region to another
External Tables in more than one metastore
• egress costs arise from data leaving region 2 (region 1 reading) Unity 3
or data leaving region 1 (region 1 writing) Catalog 4
$
user
3 authn
Catalogs
4
meta WS 2
store 2 Cluster or SQl warehouse
Data flow
read/write
Object Store Access Control by
/ UC / Workspace
Data Governance
Metadata management and access control.
Whom to provide which access at which point of time?
Platform Operations
Data teams will work on one or more platforms. Depending on the enterprise, data teams can operate their own platform, or there is a
central team that comes up with a blueprint for the setup.
Centralized Publishing
● A central BU serves as a Hub publish
BU 2 consume
● BUs are isolated from each other, e.g. by network access restrictions
● The central BU provides
● central data storage and the central metastore to publish (data, metadata & ACLs) datasets for all Central
BUs and usually BU
● central data governance and applies quality assurance on all published data BU 1 BU 3
● platform operations (secure and compliant blueprints, infrastructure setups, …)
● Often the central BU publishes own data (via a central data engineering team)
BU 2: ...
...
ACLs ACLs
Central_prd schema Z table C Central prd / dataset-C
ACLs ACLs
Unity
Metastore
BU_1_prd schema Y table B BU 2 prd / dataset-B
ACLs ACLs
BU_2_prd schema X table A BU 1 prd / dataset-A
Central tables,
Central_dev schemas views Central U C None None
Central tables,
Central_stg schemas views Central U C None None
Central tables, U C U ** U **
Central_prd schemas views Central
BU tables,
BU_1_dev schemas views BU 1 None U C None
Unity BU_1_stg
BU tables,
BU 1
schemas views
None U C None
Metastore
BU tables,
BU_1_prd schemas views BU 1 U ** U C U **
BU tables,
BU_2_dev BU 2 None None U C
schemas views
BU tables,
BU_2_stg schemas views BU 2 None None U C
_prd: production
_stg: staging
_dev: development
©2023 Databricks Inc. — All rights reserved * To access tables, USE SCHEMA and SELECT also need to be provided on schema and table level 20
** Catalogs where other BUs can be given access to schemas and tables/views by Central team
Option 2: Centralized Publishing
Single cloud-region
Data Production Central BU BU 1
● Central Ingest & ETL by the central BU
Other BUs create (business) data sets Cloud Storage
● Cloud central and BU published data Databricks
Data Publishing Storage Workspaces BU 1
● Central BU publishes data in central PRD storage and into (BU 1) DEVBU
data
1
the PRD catalog of the Central BU in UC STGBu
data1
Central Unity PRD data
● BUs requests from Central team to publish from their PRD DEV data
storage to central PRD storage and into the BU catalog in Catalog BI Tools
UC that is maintained by Central Databricks
Meta
Data Governance (centralized) Workspaces
Central store BU 2
(central)
● Central team and each BU (for non published) data can STG data
work independently on their catalogs
Cloud Storage
● Central team applies additional quality assurance and Databricks
maintains ACLs in the central BU catalog Workspaces BU 2
Central (BU 2) DEVBu
data
2
Data Consumption PRD data
central and BU published data STGBu
data
2
● Published data will be discovered in the Central catalog PRD data
and consumed from the central PRD storage
BI Tools
Platform operations
● Central team provides platform blueprints, creates
environments for BUs (automated) Publish data sets / tables and configure access permissions
Consume data from other BUs
● Central team could provide common data services
Create and consume own databases/tables
Access metadata 21
©2023 Databricks Inc. — All rights reserved
Isolated, e.g. by network access restrictions
Option 2: Centralized Publishing Process
catalog . schema . table bucket or container folders
Central / Central / …
1. Publish
data *
BU_1_prd schema X table B BU 1 / dataset-B
Central tables,
Central_dev schemas views Central U C None None
Central tables,
Central_stg schemas views Central U C None None
Central tables,
Central_prd Central U C U ** U **
schemas views
Central tables,
BU1_published schemas views Central U C U ** U **
Central tables, U C U ** U **
BU2_published schemas views Central
Unity BU tables,
BU 1 U C
BU_1_dev schemas views
None None
Metastore
BU tables,
BU_1_stg BU 1 None U C None
schemas views
BU tables, U
BU_1_prd schemas views BU 1 U C None
©2023 Databricks Inc. — All rights reserved * To access tables, USE SCHEMA and SELECT also need to be provided on schema and table level 23
** Catalogs where other BUs can be given access to schemas and tables/views by Central team
Granularity of Centralized Publishing
BU 2: ...
...
BI Tools
BU 2
1. Set ACLs
ACLs ACLs
Unity
Metastore 1
Central_prd schema Z table C Central prd / dataset-C
1. Set ACLs
ACLs ACLs
Unity
Metastore 2
BU_1_prd schema Y table B BU 1 prd / dataset-B
region 2
shared shared * * specific
Central publish. databases tables Central U C U U
ACLs
BU tables,
BU_1_prd BU 1 None # U C U **
databases views
Unity BU_1_… BU 1 None U C None
Metastore 2
BU_2_prd BU 2 None U ** U C
U USE CATALOG
C CREATE SCHEMA BU_2_ … BU 2 None # None U C
_prd: production
_stg: staging
_dev: development
$ to access tables, USE SCHEMA and SELECT also need to be provided on schema and table level
* catalog where other BUs can be given access to schemas and tables/views from Central team
©2023 Databricks Inc. — All rights reserved ** catalogs where other BUs can be given access to schemas and tables/views
31
# if Central needs access to BU data, Delta Sharing or Lakehouse Federation need to be set up
Option 2: Centralized Publishing
Multiple cloud-regions
Cloud region 1 Cloud region 2
Data Production
● Central Ingest & ETL by the central BU Central BU
● Other BUs create (business) data sets central and BU Cloud Storage
published data
Databricks
Data Publishing 1 Workspaces BU 1
● Central team publishes data in central PRD storage Cloud (BU 1) DEVBU
data
1
and into the catalog of the Central BU in Metastore 1 Storage STGBU
data1
● BUs publish by requesting from Central team to PRD data
publish from their PRD storage to central PRD storage Central BI Tools
and into the BU catalog in Metastore 1 DEV data BU 1
● Central BU will configure access control on
delta-shared data in Metastore 2 Meta Unity Meta
● Metastore 2 will be a recipient of Metastore 1 and all store 1 Catalog store 2 Isolated, e.g. by network
access restrictions
published metadata will be shared with Metastore 2 Central
Data Governance (centralized) STG data BU 2
● Access permissions are defined in Unity Catalog. Databricks 3 BI Tools
Central team will maintain access control for all Workspaces Cloud Storage
published data (with input from BUs) (central) BU 2
Central 2
● Central team might apply additional quality control Databricks DEVBU
data
2
PRD data
Data Consumption Workspaces STGBU
data
2
central and BU 1 (BU 2)
● Published data will be discovered in Metastore 2 by PRD data
published data
the BUs and consumed from the central PRD storage
Platform operations
● Central team provides platform blueprints and Publish data sets / tables,configure access permissions 1 Databricks-to-Databricks Delta Sharing
creates environments for BUs (automated) Consume other data 2 Lakehouse Federation
©2023 Databricks Inc. — All rights reserved Create and consume own databases/tables 3 JDBC / ODBC 32
Access metadata
Databricks-to-Databricks
1
Delta Sharing
2 Lakehouse Federation
3. Set ACLs
location
ACLs ACLs
Central_prd schema Z table C Central container / Central / dataset-C
Unity
BU_1_published
ACLs
schema X
ACLs
table B
/ BU 2 / dataset-A
Metastore 1
ACLs ACLs
/ BU 1 / dataset-B
4. Share with 1 or 2
Metastore 2 5. Set ACLs
ACLs ACLs G
BU 2 (D2D) schema Y’ table A’
ACLs ACLs G
BU 1 (D2D) schema X’ table B’
Unity
ACLs ACLs 2. Publish
Metastore 2
Central (D2D) schema Z’ table C’ metadata *
1. Publish
BU_2_prd schema Y table A BU 2 prd container / dataset-A
data *
BU_1_prd schema X table B BU 1 prd container / dataset-B
Unity Central_prd
Central
tables Central U C U * U *
Metastore 1 databases
BU
BU_1_published tables Central U C U * U * region 1
databases
specific
BU ACLs
BU_2_published databases
tables Central U C U * U *
shared shared
BU 2 published databases tables Central U C U * U*
region 2
shared shared * * specific
BU 1 published Central U C U U
databases tables
ACLs
shared shared
Central published databases tables Central U C U * U*
Unity BU tables,
BU_1_prd databases views BU 1 None # U C U **
Metastore 2
BU tables,
BU_1_… databases views BU 1 None U C None
BU tables,
BU_2_prd databases views BU 2 None # U ** U C
BU tables,
BU_2_… databases views BU 2 None None U C
$ to access tables, USE SCHEMA and SELECT also need to be provided on schema and table level 34
* catalog where other BUs can be given access to schemas and tables/views from Central team
©2023 Databricks Inc. — All rights reserved ** catalogs where other BUs can be given access to schemas and tables/views
# if Central needs access to BU data, Delta Sharing or Lakehouse Federation need to be set up
System Account Mappings
Current situation
Large customers (especially on Azure when they have 10s to 100s of workspaces) won’t do a big bang
migration independent of workload type
Project data
Common Delta Lake Confidential
data (opt.) data
DS: read/write
Single user
ml schema B train_data
compute
catalog (MLR)
DS: read/write
model
2) DS creates model from
features and training data
using distributed ML, GPU, …
©2023 Databricks Inc. — All rights reserved 41