Cost Control: Tags, Budgets & Billing Tables
Databricks · Architecture, Performance & Cost
Theory
Databricks bills mainly in DBUs (Databricks Units) per workload type, plus your cloud costs for classic compute and storage. To keep costs under control you need to see who uses what and stop waste. Custom tags on compute, jobs, pipelines, SQL warehouses and serverless budget policies flow into usage records, so you can split cost by team or project. The system.billing.usage table holds every usage record (date, SKU, DBUs, workspace, job or warehouse id, and custom tags), and system.billing.list_prices gives list prices to turn DBUs into money. Budgets in the account console track spending against a monthly target and email alerts when thresholds are crossed. The built-in usage dashboard gives a ready-made view.
Example: Asha tags all marketing jobs team = marketing, then a query on system.billing.usage shows the marketing team used 340 DBUs this week versus 520 for finance.
Why we use it
Cloud data platforms make it easy to leave clusters running or run expensive jobs nobody needs. Tags, billing tables and budgets turn cost into something you can measure, assign to owners and alert on before the invoice surprises anyone.
When to use it
Tag everything from day one with team, project and environment. Use auto stop and auto termination, serverless with budget policies, and job compute instead of all-purpose clusters for scheduled work. Review system.billing.usage weekly; set budgets with alerts for each team.
How it works
- Tag compute, jobs, warehouses and serverless policies
- Usage records land in system.billing.usage with tags
- Query or dashboard DBUs by team, product and job
- Is a team over its budget threshold? Yes: Budget sends an alert email. No: Keep monitoring.
- Fix waste: auto stop, right-size, job compute, remove idle jobs
- Review usage weekly
Syntax
Tags: compute/job/warehouse settings → Tags (key = value); serverless → budget policy
SQL: system.billing.usage (usage_date, sku_name, usage_quantity, usage_metadata, custom_tags, billing_origin_product)
system.billing.list_prices (sku_name, pricing.default, price_start_time, price_end_time)
UI: account console → Usage → Budgets; usage dashboardExample
-- DBUs per team (custom tag) in the last 7 days
SELECT custom_tags['team'] AS team,
billing_origin_product,
SUM(usage_quantity) AS dbus
FROM system.billing.usage
WHERE usage_date >= current_date() - INTERVAL 7 DAYS
GROUP BY ALL
ORDER BY dbus DESC;
-- Most expensive jobs this month (by DBUs)
SELECT usage_metadata.job_id, SUM(usage_quantity) AS dbus
FROM system.billing.usage
WHERE usage_date >= date_trunc('MONTH', current_date())
AND usage_metadata.job_id IS NOT NULL
GROUP BY usage_metadata.job_id
ORDER BY dbus DESC
LIMIT 10;Key points
- system.billing.usage is the source of truth for DBU consumption
- Custom tags appear in usage records, so tag compute, jobs and warehouses
- Serverless usage is attributed through budget policies and their tags
- Budgets alert by email; they do not stop workloads automatically
- Auto stop on warehouses and auto termination on clusters avoid idle cost
- Join usage with list_prices to estimate cost in currency