Sub topic 2
DBUs, SKUs, and list prices
This chapter assumes you can run SQL in a Databricks workspace and know that compute (clusters, warehouses) is billed separately from the cloud provider's infrastructure. The previous chapter split spend into Databricks charges and cloud charges. Here we look at how the Databricks part is calculated.
What a DBU is
A Databricks Unit (DBU) is a unit of processing capability per hour. Databricks bills by the second, so you pay for the fraction of an hour you use. A DBU is not money. It is a quantity that is multiplied by a price.
Each compute resource consumes DBUs at a fixed rate that depends on its type and size. A larger instance type, or a more capable warehouse size, consumes more DBUs per hour. The cloud provider's instance charge is billed separately and is not part of the DBU price.
What a SKU is
A SKU (stock keeping unit) is a billable product. It identifies the kind of workload and the pricing tier. Examples include jobs compute, all-purpose compute, SQL compute, and serverless variants. Each SKU has its own price per DBU, and the price also differs by cloud and plan tier. This is why the same DBU count can produce different bills. An hour of all-purpose compute costs more than the same hour of jobs compute on identical hardware.
SKU names appear in the sku_name column of the billing tables. They are long, uppercase identifiers that include the tier, workload type, and sometimes the region.
The cost formula
The formula is:
Databricks charge = DBU rate per hour × hours running × price per DBU for the SKU
For a cluster, add the DBU rates of the driver and all workers.
Here is a worked example with illustrative numbers, not real prices. A job cluster has one driver and four workers. Each node consumes 2 DBUs per hour. The job runs for 3 hours.
- Total DBU rate: 5 nodes × 2 = 10 DBUs per hour.
- Total DBUs: 10 × 3 = 30 DBUs.
- If the SKU price is $0.15 per DBU, the Databricks charge is 30 × 0.15 = $4.50.
The cloud provider bills the five instances separately for the same 3 hours.
Reading list prices
The table system.billing.list_prices stores the public list price for each SKU over time. Each row is valid between price_start_time and price_end_time. The current row has a null price_end_time. The pricing.default field holds the price per unit.
SELECT
sku_name,
cloud,
usage_unit,
pricing.default AS price_per_dbu
FROM system.billing.list_prices
WHERE price_end_time IS NULL
AND sku_name LIKE '%JOBS_COMPUTE%'
ORDER BY sku_name;Run this to compare prices across SKUs in your cloud. You should see that the SKUs differ even when the usage unit is the same.
Gotchas
- Prices change over time. Join usage to prices using the time window, not just the SKU name. Otherwise you can multiply old usage by a new price. A later chapter shows this join.
- List price is not your price. Negotiated discounts and commitments are not reflected in
list_prices. Treat calculated cost as an estimate. - Not every unit is a DBU. Some SKUs use other usage units. Check
usage_unitbefore summing quantities. - DBUs exclude cloud costs. A cluster that looks cheap in DBUs can still be expensive in instance hours.
Practice
Exercise
A cluster has one driver and eight workers. Every node consumes 3 DBUs per hour. The cluster runs for 2 hours under a SKU priced at $0.30 per DBU. What is the Databricks charge, and what is not included in it?
Show answer
There are 9 nodes × 3 DBUs = 27 DBUs per hour. Over 2 hours that is 54 DBUs. At $0.30 per DBU the charge is 54 × 0.30 = $16.20. The cloud provider's instance and storage charges are not included.
Exercise
Why can two clusters with the same hardware and runtime hours produce different Databricks charges?
Show answer
They can run under different SKUs, such as jobs compute and all-purpose compute. Each SKU has its own price per DBU, so the same DBU count costs different amounts.