Sub topic 1
Where the money goes: DBUs, cloud infrastructure, and storage
Prerequisites
This chapter assumes you know the basics of the Databricks workspace (notebooks, clusters, jobs) and have a general idea of cloud billing, such as instances and storage. You should also know that workspaces belong to an account and that Unity Catalog manages data access. No SQL is needed yet. Later chapters query billing tables.
Two bills, not one
A Databricks workload usually produces charges from two different vendors.
- Databricks charges. You pay Databricks for the processing you use, measured in Databricks Units (DBUs). A DBU is a unit of processing capability billed per unit of time. The number of DBUs a compute resource consumes per hour depends on its type and size.
- Cloud provider charges. In classic compute, the virtual machines run in your own cloud account. AWS, Azure, or Google Cloud bills you for those instances, for the disks attached to them, and for networking.
Total cost is the sum of both, plus storage. Looking at only one side gives a misleading picture. A cluster that looks cheap in DBUs can be expensive in instance hours, and the reverse is also true.
The three cost components
| Component | Billed by | What drives it |
|---|---|---|
| DBUs | Databricks | Compute type, instance size, hours running |
| Cloud infrastructure | Cloud provider | Instance type, count, runtime, disks, networking |
| Storage | Cloud provider | Volume of data in object storage, retained file versions |
DBUs
DBU usage is billed per SKU. A SKU is a specific billable product, such as jobs compute or SQL compute. Each SKU has its own price per DBU. The same cluster size can therefore cost different amounts depending on how you run it. The next chapter covers SKUs and list prices in detail.
Cloud infrastructure
For classic compute, every running node costs money in your cloud account, whether or not it is doing useful work. An idle cluster still accrues instance charges and DBU charges until it terminates. This is why idle time is one of the most common sources of waste.
Serverless compute changes this arrangement. Databricks runs the infrastructure, so the cloud portion is bundled into the Databricks charge. Chapter 10 covers the trade-offs.
Storage
Your data lives in cloud object storage, and the cloud provider bills for it. Delta tables keep old data files so that time travel and rollback work. Files that no table version references still occupy storage until they are removed. Many small files also make reads slower and more expensive. Storage is usually a smaller line item than compute, but it grows steadily if nobody maintains it.
A worked example
Suppose a job cluster has one driver and four workers, and runs for 2 hours. Assume each node consumes 1.5 DBUs per hour, the jobs compute rate is $0.15 per DBU, and each instance costs $0.30 per hour. These figures are illustrative, not real prices.
- Nodes: 5
- DBUs: 5 nodes × 1.5 DBU/hour × 2 hours = 15 DBUs
- Databricks charge: 15 × $0.15 = $2.25
- Cloud charge: 5 nodes × $0.30 × 2 hours = $3.00
- Total: $5.25
In this example the cloud bill is larger than the Databricks bill. Reports built only on DBU data would hide more than half the cost.
Where each charge appears
Databricks usage data, available in the billing system tables, covers DBUs. Instance and storage charges appear only in your cloud provider's billing tools, such as AWS Cost Explorer or Azure Cost Management. To see the whole picture, you need both sources, and tags on compute help you connect them. Tagging is covered in a later chapter.
Exercise
A team runs a classic job cluster for 3 hours with 3 nodes. Each node uses 2 DBUs per hour at $0.10 per DBU, and each instance costs $0.40 per hour. What are the Databricks charge, the cloud charge, and the total?
Show answer
DBUs = 3 nodes × 2 DBU/hour × 3 hours = 18 DBUs, so the Databricks charge is 18 × $0.10 = $1.80. The cloud charge is 3 nodes × $0.40 × 3 hours = $3.60. The total is $5.40. The cloud portion is twice the Databricks portion.
Exercise
Why can a report based only on DBU usage understate the cost of a classic cluster?
Show answer
Classic clusters run on instances in your own cloud account, and the cloud provider bills for those instances, disks, and networking separately. DBU data covers only the Databricks charge.