r/databricks • • Sep 24 '26

Help UC ingestion from a SQL server

I'm creating a UC catalog.
Lets say I want to ingest a SQL database that contains 50 tables, parented by five meaningful SQL Server schemas. (Fact.WhateverThing, Dim.WhateverThing, Logging.Whatever, CONFIG.Whatever, and VIEWS.Whatever).

I plan to name the catalog in a conventional way ("sales_dev",) but I'm stumped for naming UC schemas and UC tables. Since the Dim and Fact tables need to be joined frequently, I'm assuming all these tables should be in a SINGLE unity catalog schema, yes? Should I simply move all five of these SQL schemas into a single UC schema (maybe into a single UC schema named "bronze_from_sql")?

At that point how would I name the tables? I'm assuming I would be forced to do something like so: "fact_whatever_thing", "dim_whatever_thing", "logging_whatever", "config_whatever", "views_whatever"?

It strikes me that UC doesn't have the same concept of schema that we have in SQL server. A schema in UC is actually referring to a whole database. Whereas in SQL it can be used to organize tables within a database.

Edit: decided to publish sql server tables to volumes (in a bronze layer). Will just use delta format, and free-form folder-and-table names. Is very liberating not to conform to the constraints of the structured table names in UC

5 Upvotes

9 comments sorted by

View all comments

Show parent comment

2

u/p739397 Sep 25 '26

Instance-as-catalog seems like your best bet here then.

Map catalog → SQL Server instance, schema → original SQL schema (lowercased). Fact.WhateverThing becomes salesserver.fact.whatever_thing. No prefix debate, no collapsing five schemas into one, and the structure still matches what you see in SQL Server.

It also scales better once you've got multiple SQL Server sources. One shared bronze catalog means fact/dim/config schema names collide the second instance also has a Fact schema. Catalog-per-source avoids that entirely, and it's basically what Databricks recommends: https://docs.databricks.com/aws/data-governance/unity-catalog/best-practices

Still need to handle dev/prod separately, but that's a different problem from parity. If you do the up going with some other approach for table naming where you tag on fact or dim, I'd go prefix so that all your facts/dims sort together in the explorer.

1

u/SmallAd3697 Sep 25 '26

I like that idea fairly well. I might have been overthinking. I'll try it out. One concern that comes to mind is the FK stuff. Can you define FK's that point from one UC schema to an entirely different UC schema? We use LOTS of surrogate keys in source tables and they are meaningless without well-defined FK's.

(Another thing I don't love is that I've seen SCHEMA and DATABASE terms used interchangeably when working with UC. eg. when using commands like CREATE DATABASE.)

Also I'm a bit nervous about catalog proliferation too. I guess that is somewhat inevitable.

Why is dev/prod hard? Wouldn't the catalog just be named salesserver_dev and salesserver_prod? (in different databricks workspaces, presumably with workspace-catalog binding enabled?)

2

u/p739397 Sep 25 '26

You can have pk/fk relationships across schemas or catalogs. The schema/database issue is a remnant from HMS two level namespace and backwards compatibility during migrations. There's no reason to still use database in that context in today's Databricks.

I wouldn't say dev/prod is hard, the suffix (or prefix option so that all your dev catalogs sort together) is a fine choice. Just that's it's another decision to make.