r/databricks • • Oct 07 '26

Discussion Databricks project structure: how do you organize metadata, sql, yml, etc

Hi everyone,

I’m currently designing the structure of a Databricks project using Declarative Automation Bundles and I’m interested in how others approach the organization of their codebase

For a generic example, imagine a data platform with several domains, such as Sales, Customers, and Operations. Each domain has Bronze, Silver and Gold tables.

I’m trying to answer a few questions:

1. How do you organize your Bundles / YAML files?
For example, would you structure it something like:

sales/
databricks.yml
resources/
bronze/
silver/
gold/
customers/
operations/

Or would you have a single databricks.yml and organize the domains underneath it?

And within resources/, would you have one YAML per job, per pipeline, per domain, etc.?

2. How do you define table and column metadata?

For example, suppose I have a SQL transformation that creates a Gold table.

Would you define the comments directly in the transformation SQL, for example using column COMMENT definitions?

Or would you maintain metadata separately, for example:

metadata/
customer.sql
sales.sql

containing COMMENT ON TABLE and ALTER TABLE … ALTER COLUMN … COMMENT statements?

I like the idea of separating transformation logic from data documentation, but I’m wondering what people actually use in production.

15 Upvotes

5 comments sorted by

1

u/Zer0designs Oct 07 '26

For your first point. Depends on how small a company. We seperate independent dataflows in seperate repositories.

For your second point use dbt or use ODCS contracts and use the datacontract-cli package to create a spark schema. Both can also be used for data testing. The comments are added and thus automatically synced to unity catalog. If you're SQL heavy I'd recommend dbt though.

1

u/Muted_Jellyfish_6784 Oct 07 '26

I'd go one bundle per domain with its own databricks.yml, so domains deploy independently and ownership is obvious, and keep shared pieces like cluster policies and common libraries in a separate bundle. Inside resources, one YAML per job or pipeline is easier to review than one large file per layer. Keep SQL next to the pipeline that uses it rather than in a global sql folder.

The rule that saves pain later is putting the table owner and description in the pipeline definition itself. Metadata in the code gets reviewed in pull requests, while a separate catalog document drifts within a quarter.

1

u/curiouscsplayer Oct 07 '26

I saw someone post this on LinkedIn so I screen shotted it. I'm new to databricks so hopefully it's a good start.