Sub topic 1
What Unity Catalog does
Unity Catalog is the data governance layer in Databricks. It gives you one place to define data objects, control who can use them, and see what exists. This chapter explains the problem it solves and the model the rest of the tutorial builds on.
Prerequisites
This chapter assumes you already have the following:
- Basic SQL (CREATE, SELECT, INSERT).
- Familiarity with Databricks workspaces and notebooks or the SQL editor.
- A basic idea of tables stored as files in cloud object storage.
- A general understanding of users, groups, and access control.
The problem it solves
Without a central governance layer, each Databricks workspace keeps its own list of tables and its own permissions. Two workspaces that read the same files can disagree about who may see them. Access rules end up copied by hand, and nobody can answer simply, "Who can read this table?"
Unity Catalog moves those definitions out of individual workspaces. You define data objects and permissions once, and every attached workspace uses the same definitions.
What it provides
- A single namespace. Every table is addressed the same way in every workspace.
- Centralized access control. You grant privileges with standard SQL
GRANTandREVOKEstatements. - Governed storage access. Access to cloud storage paths is controlled through Unity Catalog objects, not by handing out raw cloud credentials.
- Discoverability. You can list and inspect objects with
SHOW,DESCRIBE, andinformation_schema.
The object model in one picture
Unity Catalog arranges objects in a hierarchy. The metastore is the top-level container. Inside it are catalogs, inside catalogs are schemas, and inside schemas are tables and other objects.
Each box in the diagram is a securable object. A securable object is something you can grant privileges on. Privileges granted on a higher object can apply to the objects below it, a behavior called inheritance. A later chapter covers it in detail.
A first look
Objects are named with three parts: catalog, schema, and table. The following statements create one object at each level.
CREATE CATALOG IF NOT EXISTS dev;
CREATE SCHEMA IF NOT EXISTS dev.sales;
CREATE TABLE IF NOT EXISTS dev.sales.orders (
order_id BIGINT,
customer_id BIGINT,
order_ts TIMESTAMP,
amount DECIMAL(10,2)
);The table is now addressed as dev.sales.orders from any workspace attached to the same metastore. You can then give a group read access with GRANT, and the same rule applies everywhere.
Common mistakes
- Treating a workspace as the boundary for data. In Unity Catalog, the metastore is the boundary. A workspace only has access to a metastore through an assignment.
- Granting only SELECT on a table. A user also needs privileges on the parent catalog and schema before the table is usable. The privileges chapter shows the exact set.
- Assuming governance covers everything automatically. Unity Catalog controls access through its own objects. Data reached by other routes, such as direct cloud storage credentials, is outside its checks.
What comes next
The next chapter looks at the metastore, the container that holds everything else. After that, the tutorial works down the hierarchy to catalogs, schemas, and tables, and then covers ownership, privileges, and storage.
Exercise
A team has two workspaces that read the same data. Name two problems that appear when each workspace manages its own tables and permissions, and say how Unity Catalog addresses them.
Show answer
Table definitions and access rules can differ between the workspaces, and they must be copied by hand, so it is hard to know who can read a table. Unity Catalog stores definitions and privileges once in a metastore, and every attached workspace uses the same ones.
Exercise
Write the fully qualified name of a table called orders in the schema sales of the catalog dev.
Show answer
dev.sales.orders