Sub topic 1
What Unity Catalog Does
Prerequisites
Assume you know basic SQL such as CREATE, SELECT, and INSERT. You should also know that Databricks workspaces run notebooks or SQL queries, and that tables usually use cloud object storage. You should understand users, groups, and access control.
What Unity Catalog Does
Unity Catalog is Databricks' centralized system for organizing and governing data and other securable objects. It stores metadata, records ownership, and controls who can discover or use data. Instead of configuring permissions separately in each workspace, administrators can manage access through a shared catalog structure.
Unity Catalog also gives objects consistent names. This makes SQL easier to move between workspaces and helps teams apply consistent governance.
The Metastore: The Top-Level Container
A metastore is the top-level Unity Catalog container for a cloud region. It holds metadata about catalogs, schemas, tables, views, permissions, and ownership. It does not mean that every data file is copied into one central database.
A metastore can serve multiple Databricks workspaces. The workspaces must be assigned to that metastore, and users still need privileges on the objects they access.
Attaching a Metastore to Workspaces
An account administrator creates or selects a metastore and assigns it to workspaces in the matching region. After assignment, those workspaces use the metastore's catalogs and governance rules. Workspace access and data privileges remain separate decisions.
The Three-Level Namespace
Unity Catalog names data with three levels:
catalog.schema.table
For example, dev.sales.orders means the orders table in the sales schema inside the dev catalog. This fully qualified name avoids ambiguity when several schemas contain tables with the same name.
CREATE CATALOG IF NOT EXISTS dev;
CREATE SCHEMA IF NOT EXISTS dev.sales;
CREATE TABLE IF NOT EXISTS dev.sales.orders (
order_id BIGINT,
amount DECIMAL(10,2)
);Catalogs
A catalog is the first organizational and security boundary below the metastore. Organizations often create catalogs for environments such as dev, test, and prod, or for major business domains. Choose boundaries that match ownership and access needs. A catalog can contain many schemas, and each schema can contain many tables.
Exercise
What does dev.sales.orders identify?
Show answer
It identifies the orders table in the sales schema within the dev catalog.