Exercises: Unity Catalog
Set up a namespace, configure access controls, trace lineage, and query audit logs — all in a Databricks workspace with Unity Catalog enabled.
Unity Catalog hands-on (SQL, Databricks workspace) #
This exercise runs in a Databricks SQL editor on a workspace with Unity Catalog enabled. A free 14-day trial workspace includes Unity Catalog. You cannot run these exercises locally — Unity Catalog requires the managed Databricks control plane.
Open modules/05-unity-catalog/exercises/05_unity_catalog.sql in a Databricks SQL editor and work through each section in order.
What you will do #
- Explore the existing metastore — see what catalogs and schemas exist by default
- Create a catalog (
learning) and schema (sensors) to establish your own namespace - Create a managed Delta table (
gold_hourly_stats) with sample turbine data - Grant and revoke permissions — verify that access is denied before a GRANT and allowed after
- Add metadata — column comments, table tags for discoverability
- Trace lineage — run a query and observe the lineage graph in Catalog Explorer
- Query audit logs — find your own recent activity in
system.access.audit
Prerequisites #
- A Databricks workspace with Unity Catalog enabled (free trial works)
- Access to a SQL warehouse (serverless or pro)
- Permission to create catalogs (workspace admin, or granted
CREATE CATALOGon the metastore)
After running #
You should be able to answer these reflection questions (they appear at the end of the SQL file):
- What is the difference between
GRANTon a table vs.GRANTon a schema? When would you use each? - You find in the audit log that a user queried a CEII table they should not have access to. What do you do? What in UC prevents this in the future?
- What is the difference between the
learningcatalog you created and themaincatalog that exists by default? - A new data engineer joins the team. What is the minimum set of grants they need to work with the sensors schema?
Governance ROI cost model (CalcMark) #
Unity Catalog is included in Databricks Premium tier — there is no separate SKU. So what does governance actually cost to operate, and how does that compare to the cost of a NERC CIP violation?
Open modules/05-unity-catalog/exercises/governance-roi.cm and run it:
cm eval governance-roi.cm -v
What the model covers #
- The cost of Unity Catalog governance — engineer time managing permissions and audit logs, system table storage, staff training. Spoiler: it is about $13K/year.
- The cost of NOT having governance — NERC CIP penalty structure, real-world settlements (Duke Energy’s $10M for 127 violations), and what a first audit looks like when your access controls live in a spreadsheet.
- The DIY alternative — building governance from Atlan/Alation + custom engineering. Works, but costs about 5x more than UC governance.
- The break-even question — UC pays for itself if it prevents one NERC finding every 57 years. The business case is not subtle.
- Scaling to 1,000 turbines — governance costs scale sublinearly (ABAC policies, not per-user grants), but regulatory risk scales superlinearly.
What to do with it #
- Read through the assumptions and sources. Do you agree with the numbers? Change any that seem wrong and rerun.
- Set
likely_findings = 1— even one finding justifies decades of UC governance spend. - Set
governance_hours_weekly = 4(the upper end) — does the break-even change meaningfully? - Compare
total_governance_ongoingtodiy_total. When would you choose DIY governance over Unity Catalog?
Reflection #
After running the model, you should be able to answer:
- Why is the break-even calculation almost irrelevant to the actual decision?
- A customer says “we already have Atlan for our data catalog, why do we need Unity Catalog?” What is the honest answer?
- What governance capabilities does Unity Catalog provide that a standalone catalog like Atlan cannot?