Sub topic 1
What Unity Catalog Does
Unity Catalog is the governance layer for data and AI assets in Databricks. It gives you one place to define what data exists, who can use it, and how its use is recorded. This chapter explains the problem it solves and the model it uses. Later chapters cover each object in detail.
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.
You do not need admin rights to follow the concepts. To run the SQL examples you need a workspace attached to a Unity Catalog metastore and permission to create objects in it.
The problem Unity Catalog solves
Before Unity Catalog, each Databricks workspace kept its own table definitions and its own access rules. Teams that ran several workspaces, for example one for development and one for production, ran into the same problems:
- Table definitions were copied or re-registered in each workspace, so they drifted apart.
- Permissions were configured per workspace, and often per cluster, so the same person could have different access in different places.
- Access to the files behind a table depended on cloud credentials attached to compute, not on who the user was.
- There was no single record of who read or changed which data.
Unity Catalog moves these concerns out of the workspace and into an account-level service. Definitions, permissions, and audit information live in one place and apply to every workspace that is connected to it.
What you get
Unity Catalog provides four main capabilities.
| Capability | What it means in practice |
|---|---|
| Central metadata | Tables, views, and other objects are defined once, in one catalog of record, and used from any attached workspace. |
| Central access control | Privileges are granted with standard SQL (`GRANT` and `REVOKE`) to users, groups, and service principals. |
| Storage governance | Access to cloud storage is controlled through objects in Unity Catalog instead of credentials spread across clusters. |
| Auditing and discovery | Access is logged, and objects can be listed and described with SQL and `information_schema`. |
The rest of this tutorial builds these up one piece at a time.
The core model
Unity Catalog organizes everything in a hierarchy. At the top is the metastore. Inside it are catalogs, inside catalogs are schemas, and inside schemas are tables and other objects.
An object that you can secure is called a securable object, or securable. Every box in the diagram above is a securable. You grant privileges on securables, and privileges granted higher up can apply to the objects below them. That inheritance is covered in a later chapter.
The metastore
The metastore is the top-level container for metadata. It stores the definitions of the objects below it and the permissions on them. A metastore belongs to a cloud region. The next chapters explain what it contains and how workspaces are attached to it.
The three-level namespace
Every table is addressed by three names separated by dots: catalog.schema.table. Because the metastore is shared by all attached workspaces, dev.sales.orders means the same table in each of them.
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)
);This creates a catalog, a schema inside it, and a managed table. The table is then addressed as dev.sales.orders.
You can write to the table and read from it using that full name.
INSERT INTO dev.sales.orders VALUES
(1, 100, TIMESTAMP'2026-01-15 09:30:00', 25.50),
(2, 101, TIMESTAMP'2026-01-15 10:05:00', 80.00);
SELECT customer_id, SUM(amount) AS total_amount
FROM dev.sales.orders
GROUP BY customer_id;If you set a current catalog and schema, you can use the short name instead.
USE CATALOG dev;
USE SCHEMA sales;
SELECT * FROM orders;The short name is only a convenience. The table is still dev.sales.orders, and a query run in a session with a different current catalog would resolve orders to a different table, or fail.
How access control works
Access in Unity Catalog is closed by default. A user can see or use an object only if they own it or have been granted a privilege on it. Privileges are granted to principals, which are users, groups, and service principals. Granting to groups is the usual practice because membership can change without editing grants.
Reading a table takes more than SELECT on the table. The user also needs the right to enter the parent catalog and schema.
GRANT USE CATALOG ON CATALOG dev TO `data-analysts`;
GRANT USE SCHEMA ON SCHEMA dev.sales TO `data-analysts`;
GRANT SELECT ON TABLE dev.sales.orders TO `data-analysts`;A frequent error is granting only SELECT on the table. The user then still cannot query it, because they lack USE CATALOG and USE SCHEMA on the parents.
Because privileges can be granted on a schema, you do not have to grant table by table.
GRANT SELECT ON SCHEMA dev.sales TO `data-analysts`;
SHOW GRANTS ON SCHEMA dev.sales;A schema-level SELECT applies to the tables in that schema, including tables created later. To take it away:
REVOKE SELECT ON SCHEMA dev.sales FROM `data-analysts`;Where the data lives
A Unity Catalog table is metadata plus data files in cloud object storage. The two kinds of table differ in who controls those files.
- A managed table stores its files in a location that Unity Catalog manages. Dropping the table also removes its data.
- An external table points at files at a path you choose. Unity Catalog governs access to the table, but the files are yours to manage.
The CREATE TABLE statement for orders above has no LOCATION, so it is managed. To create an external table, you give a path.
CREATE TABLE dev.sales.raw_orders (
order_id BIGINT,
payload STRING
)
LOCATION 's3://example-bucket/raw/orders';The bucket name is a placeholder. This statement succeeds only if the path is covered by an external location that you are allowed to use. An external location pairs a storage path with a storage credential, which is the identity Unity Catalog uses to reach that storage. Users read and write through Unity Catalog, so they do not need direct cloud credentials.
Looking at what exists
You can explore each level with SQL.
SHOW CATALOGS;
SHOW SCHEMAS IN dev;
SHOW TABLES IN dev.sales;
DESCRIBE EXTENDED dev.sales.orders;DESCRIBE EXTENDED shows the details of one table, including whether it is managed or external. Each catalog also has an information_schema that you can query like any other schema.
SELECT table_schema, table_name, table_type
FROM dev.information_schema.tables
WHERE table_schema = 'sales';You will only see objects you have some privilege on, so the results depend on who runs the query.
Common mistakes
- Using short names without checking the current catalog and schema. The same
SELECT * FROM orderscan return different data in different sessions. - Granting
SELECTon a table withoutUSE CATALOGandUSE SCHEMAon its parents. - Granting to individual users instead of groups, which makes later cleanup harder.
- Creating an external table at a path that no external location covers, which fails with a permission error.
- Assuming that dropping an external table deletes its files. Only managed table data is removed with the table.
Where this tutorial goes next
The following chapters take the model apart in order: the metastore and how workspaces attach to it, the namespace, catalogs, schemas, tables, managed and external tables, principals and ownership, privileges and inheritance, storage access, other securables, inspection, and layout design.
Exercise
A user in the data-analysts group has been granted SELECT ON TABLE dev.sales.orders and nothing else. They run SELECT * FROM dev.sales.orders and get a permission error. What is missing, and what statements fix it?
Show answer
The group lacks the right to use the parent objects. It needs USE CATALOG on dev and USE SCHEMA on dev.sales. The statements are GRANT USE CATALOG ON CATALOG dev TO data-analysts; and GRANT USE SCHEMA ON SCHEMA dev.sales TO data-analysts;.
Exercise
You create dev.sales.raw_orders with LOCATION 's3://example-bucket/raw/orders' and later drop the table. What happens to the files at that path, and why?
Show answer
The files remain. The table is external, so Unity Catalog governs access to it but does not own the files. Dropping an external table removes only its metadata. Dropping a managed table would also remove its data.