What you will be able to do
- Lay out development, staging and production workspaces and catalogs for an ML project, sized to the team
- Set catalog access and workspace-catalog bindings so production data stays isolated
- Explain what an MLOps Stacks project contains and how its CI/CD moves code from dev to staging to prod
- Choose infrastructure-as-code tooling, cluster access modes, bundle boundaries and workspace naming so ML environments scale without drifting apart
Key concept
Promote code, not models — ML pipeline code moves from dev to staging to production. Each environment then runs that code to train and register its own model. The production model is never a copy of an artifact trained somewhere else; production code builds it from production data.
1.Separate execution environments per stage
An execution environment is where code creates or uses models and data. Each one has its own compute, runtimes, libraries and automated jobs. Databricks recommends a separate environment for each stage of ML work, usually called development, staging and production, with clearly defined handoffs between them. Development has few access limits and little testing. Production is tightly controlled. Staging sits between them, and it's where a change gets tested before production depends on it.
How many workspaces you need depends on team size and regulation. A small team of up to five data engineers can start with two workspaces, development and production. Once a team grows past five, it should move to three workspaces with staging in the middle. Staging should behave like production, with the same bundle configuration, schema and critical integrations, even if it runs at a smaller scale. Regulated industries such as banking, healthcare and defense should physically isolate workspaces and cloud accounts. The opposite mistake also hurts scale: separate workspaces for individual teams or small projects. Use Unity Catalog catalogs and schemas to isolate those instead.
The thing that crosses environment boundaries is code. Pipelines and code live in Git, so moving ML logic between stages means moving code from the development branch to the staging branch and then to the release branch. Because only code moves, every change to the ML process gets the same code review and integration testing. Each environment's training pipeline also leaves its model artifact in that workspace's own MLflow Tracking server.
An environment layout scales only if it can be rebuilt the same way every time. Use Terraform for infrastructure, meaning workspaces, networks, Unity Catalog and storage, and use bundles for the data and AI workloads that run inside it: jobs, pipelines, notebooks and models. Don't create production workspaces by hand, and don't mix IaC with manual configuration. Either habit produces snowflake workspaces that no longer match their siblings, and then staging stops predicting what production will do. Start with serverless workspaces. Switch to classic ones only when a specific network or compliance requirement calls for it.
Cluster access mode decides whether ML code runs at all. In a workspace assigned to Unity Catalog, Standard access mode lets several users share a cluster and supports fine-grained access control. It doesn't support the Databricks Runtime for Machine Learning, although many ML libraries can be installed on the standard runtime. Dedicated access mode supports the ML runtime and every language. A dedicated cluster belongs either to one user or to one group, and the group's members can share it. A workspace built for ML typically combines GPU clusters and the ML runtime with MLflow enabled.
Bundles also scale best when each one covers every environment of a project. A single bundle deployed to dev, staging and production through its targets keeps all three on the same definitions, while separate bundles for each environment slowly drift apart. Databricks recommends small, focused bundles over one large one. Split them along these lines instead:
- Different products or domains, such as billing analytics and fraud detection
- Different ownership or permission boundaries
- Workloads with clearly different lifecycles
- Cases that need independent promotion or rollback
Names start to matter once workspaces multiply. A pattern such as {organization}-{environment}-{region}-{purpose} gives names like acme-prod-us-west-analytics and acme-staging-us-east-dataeng: lowercase letters and hyphens, under 50 characters, and always with the environment in them. Going beyond 50 to 100 workspaces needs strong justification and robust automation. A dev/staging/prod split multiplied across business units reaches that range faster than most teams expect.
Checkpoint 1 of 5· Check yourself
A data scientist has changed the model training pipeline in the development workspace. In a three-workspace setup, where should the change get its integration tests before production depends on it?
Staging sits between dev and prod and behaves like production, so changes get tested there before production depends on them. Development has little testing, production is tightly controlled, and Databricks advises against separate workspaces per project.
“PRs trigger unit tests and integration tests in an isolated staging Databricks workspace.”Source: docs.databricks.com
Checkpoint 2 of 5· Check yourself
Four members of the ml-team group want to share one cluster in a Unity Catalog workspace, and their training notebooks need the Databricks Runtime for Machine Learning. Which access mode fits?
Standard mode doesn't support the ML runtime. Dedicated mode does, and a cluster dedicated to a group can be shared by that group's members, while a single-user dedicated cluster is accessible to its one assigned user only.
“Dedicated for a single group: Multiple users of the same group can work on the same cluster (the group is assigned during cluster creation).”Source: docs.databricks.com
2.One catalog per environment, with access to match
Data and models are split by environment the same way workspaces are. Use a single Unity Catalog metastore and give dev, staging (if you have it) and production their own catalogs, mirroring the workspace layout. A training pipeline should register its model to the catalog for the environment it ran in. Dev runs register to the dev catalog, and prod runs register to the prod catalog. Because the catalog name changes per environment, the same code can run unchanged in all three.
| Catalog | Data scientist access | What it holds |
|---|---|---|
| dev | Read-write | Temporary data and feature tables, plus models registered during development |
| prod | Read-only, ideally | Production data, inference tables, metric tables and production models to load for comparison |
Read-only access to prod lets data scientists analyse current production predictions and performance without being able to change them. If governance doesn't allow even that, write a snapshot of production data into the dev catalog and develop against the snapshot.
Privileges alone don't fully isolate a catalog. By default, every catalog is reachable from any workspace attached to the same metastore. Workspace-catalog binding limits a catalog to specific workspaces. A user in an unbound workspace gets an error even if they hold a direct grant. For example, a user with SELECT on a table in prod_catalog still can't read it from the Dev workspace if the catalog is bound only to production workspaces. A binding can also be read-only for a given workspace. The recommended setup binds the production catalog in ISOLATED mode to the production workspace only, so production data stays out of reach even if someone misconfigures an identity.
Checkpoint 3 of 5· Check yourself
One training pipeline runs unchanged in the dev, staging and production workspaces, which share one Unity Catalog metastore. When the production run finishes, where should it register its model?
Each environment has its own catalog on the shared metastore. A pipeline registers its model to the catalog of the environment it ran in, so prod runs register to the prod catalog. The code is what gets deployed, not a model copied over from dev.
“Representing the model development process as code enables you to deploy the code instead of deploying the model.”Source: docs.databricks.com
3.What an MLOps Stacks project contains
MLOps Stacks is a Databricks project template that applies this environment layout from the start. Running databricks bundle init mlops-stacks asks for configuration details, then writes a directory implementing the MLOps workflow Databricks recommends. You only edit the files to add your own logic. It needs Databricks CLI 0.212.2 or above and a target workspace with workspace files enabled.
The default stack has three components:
- ML code: template notebooks for training, batch inference and similar tasks, with a standard structure that is modular and ready for testing.
- ML resources as code: resources such as workspaces and pipelines for training and batch inference, defined in bundles. That puts infrastructure changes, such as a larger instance type for retraining, under version control.
- CI/CD: GitHub Actions or Azure DevOps workflows that test and deploy the code and resources, so every production change goes through automation.
The first init prompt lets each role set up only what it needs. You can rerun the command later to add the other part.
| Option | Sets up | Typical user |
|---|---|---|
| CICD_and_Project (default) | Both ML code and CI/CD components | Whoever starts the project |
| Project_Only | ML code components only | Data scientists getting started |
| CICD_Only | CI/CD components only | ML engineers setting up infrastructure |
The generated project includes role-specific guides. Data scientists start in <project-name>/README.md, update production ML code following docs/ml-pull-request.md, and change training or inference jobs through <project-name>/resources/README.md. MLOps or DevOps engineers set up CI/CD with docs/mlops-setup.md. Behind the template sit Databricks notebooks and MLflow for development, Models in Unity Catalog as the model repository, Model Serving, Lakeflow Jobs as the orchestrator, and bundles as infrastructure-as-code.
Checkpoint 4 of 5· Match them up
Match each component of the default MLOps Stack to what it contributes to a new project.
Tap a term, then the definition that fits it.
MLOps Stacks splits a project into three parts. ML code is the template notebooks. ML resources as code puts the jobs and pipelines in bundles, so infrastructure changes are tracked in version control. CI/CD automates testing and deployment, so production changes don't happen by hand.
“Resources are defined in Declarative Automation Bundles to facilitate testing, optimization, and version control for the ML environment.”Source: docs.databricks.com
4.How MLOps Stacks CI/CD moves code between environments
The default stack's CI/CD tests and deploys the training and batch inference jobs across dev, staging and production workspaces. A change takes this path:
- Data scientists iterate on ML code in the development workspace and open a pull request.
- The PR triggers unit and integration tests in an isolated staging workspace.
- When the PR merges to
main, the training and batch inference jobs in staging update right away to run the latest code. - On the release schedule, someone cuts a release branch from
main, and CI/CD deploys those code changes to production.
The tests themselves, meaning what each suite checks and which belong at which stage, are covered in which tests run in which environment stage. Within the stack, the triggers are pull requests, merges to main and release branches. The tests run in staging, so code reaches production only after it has passed there.
No person runs the staging and production deployments. ML engineers set up Databricks service principal secrets for CI/CD, and the CI/CD runner uses them to run notebooks and create jobs in the staging and production workspaces. Interactive OAuth user-to-machine login is fine for trying things from a laptop. For fully automated workflows, Databricks recommends OAuth machine-to-machine authentication with a service principal.
Checkpoint 5 of 5· Put it in order
Put these stages of an ML code change's path through the default MLOps Stacks CI/CD in order, from first to last.
- 1.On the release schedule, a release branch is cut from main and CI/CD deploys the code changes to production
- 2.The pull request merges to main, and the staging training and batch inference jobs update to run the latest code
- 3.A data scientist iterates on the training code in the development workspace and opens a pull request
- 4.The pull request triggers unit and integration tests in an isolated staging workspace
The code is tested in staging when the PR is opened. Staging jobs pick it up once it merges to main. It reaches production only when a release branch is cut, so production gets code that has already passed in staging.
“PRs trigger unit tests and integration tests in an isolated staging Databricks workspace. When a PR is merged to main, model training and batch inference”Source: docs.databricks.com
Sources7
Sources
(7)
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.
“Databricks recommends creating separate environments for the different stages of ML code and model development with clearly defined transitions between stages.”
↩︎ Separate execution environments per stage“In most situations, Databricks recommends that during the ML development process, you promote code, rather than models, from one environment to the next.”
↩︎ Separate execution environments per stage“Set up your pipeline code to register the model to the catalog corresponding to the environment that the model pipeline was executed in”
↩︎ One catalog per environment, with access to match“Ideally, data scientists working in the development workspace also have read-only access to production data in the prod catalog.”
↩︎ One catalog per environment, with access to match“In most situations, Databricks recommends that during the ML development process, you promote code, rather than models, from one environment to the next.”
↩︎ Key concept“It also ensures that the production version of the model is trained on production code.”
↩︎ Prediction - 2.
“Growing teams (5+ data engineers): Move to three workspaces (development, staging, and production).”
↩︎ Separate execution environments per stage“Each bundle should cover all environments for a given project (dev, staging, production) rather than using separate bundles per environment.”
↩︎ Separate execution environments per stage“create separate catalogs for dev, staging (if applicable), and production, mirroring your workspace layout.”
↩︎ One catalog per environment, with access to match“Bind the production catalog in ISOLATED mode to the production workspace only.”
↩︎ One catalog per environment, with access to match“During development, configure bundles to use a personal schema per user, for example dev_${user_name}.”
↩︎ One catalog per environment, with access to match - 3.https://docs.databricks.com/aws/en/lakehouse-architecture/deployment-guide/workspace-strategyOfficial docs
“Do not create separate workspaces for individual teams or small projects (use Unity Catalog catalogs and schemas for isolation instead).”
↩︎ Separate execution environments per stage“Start with serverless workspaces and switch to classic workspaces only when you have specific network or compliance requirements.”
↩︎ Separate execution environments per stage“No support for the Machine Learning ML DBR (but many ML libraries can be installed on the standard DBR).”
↩︎ Separate execution environments per stage“Do not deploy more than 50-100 workspaces without strong justification and robust automation.”
↩︎ Separate execution environments per stage“Dedicated for a single group: Multiple users of the same group can work on the same cluster (the group is assigned during cluster creation).”
↩︎ Checkpoint - 4.
“Use Declarative Automation Bundles for data and AI workloads (for example, jobs, pipelines, notebooks, models).”
↩︎ Separate execution environments per stage“Do not mix IaC and manual configuration (choose one approach).”
↩︎ Separate execution environments per stage“ML workspace: GPU clusters, ML runtime, MLflow enabled.”
↩︎ Separate execution environments per stage“Use Terraform for infrastructure resources (for example, workspaces, networks, Unity Catalog, storage).”
↩︎ Exam trap 2 - 5.https://docs.databricks.com/aws/en/data-governance/unity-catalog/access-control/workspace-catalog-bindingOfficial docs
“When binding a catalog to a workspace, you can optionally restrict that workspace to read-only access.”
↩︎ One catalog per environment, with access to match“Access from an unbound workspace is denied, even for users with explicit privilege grants on the catalog.”
↩︎ Exam trap 3 - 6.
“An MLOps Stack is an MLOps project on Databricks that follows production best practices out of the box.”
↩︎ What an MLOps Stacks project contains“CICD_Only - Set up CI/CD components only. This option is for ML engineers to set up infrastructure.”
↩︎ What an MLOps Stacks project contains - 7.
“ML resources as code. MLOps Stacks defines resources such as workspaces and pipelines for tasks like training and batch inference.”
↩︎ What an MLOps Stacks project contains“PRs trigger unit tests and integration tests in an isolated staging Databricks workspace.”
↩︎ How MLOps Stacks CI/CD moves code between environments“When a PR is merged to main, model training and batch inference jobs that run in staging immediately update to run the latest code.”
↩︎ How MLOps Stacks CI/CD moves code between environments“E: The CI/CD runner runs notebooks, creates jobs, and performs other tasks in the staging and production workspaces.”
↩︎ How MLOps Stacks CI/CD moves code between environments“Representing the model development process as code enables you to deploy the code instead of deploying the model.”
↩︎ Exam trap 1“PRs trigger unit tests and integration tests in an isolated staging Databricks workspace.”
↩︎ Checkpoint“Representing the model development process as code enables you to deploy the code instead of deploying the model.”
↩︎ Checkpoint“Resources are defined in Declarative Automation Bundles to facilitate testing, optimization, and version control for the ML environment.”
↩︎ Checkpoint“PRs trigger unit tests and integration tests in an isolated staging Databricks workspace. When a PR is merged to main, model training and batch inference”
↩︎ Checkpoint