In Parts 1 and 2 we explored what Databricks Lakebase is and how it performs. Now we’ll make Lakebase costs fully transparent—and operational. This article shows exactly how to calculate spend from system tables, standardize the math as reusable SQL views, and publish a shareable AI/BI dashboard that your team can deploy in minutes.
Lakebase is always-on OLTP. Unlike auto-stoppable OLAP compute, its cost profile hinges on continuous readiness. Getting cost wrong (or opaque) risks budget surprises; getting it right unlocks predictable operations, fair back-charging, and faster decisions.
catalog.schema
that mirror the working logic (storage ×10 factor, database_instance_id
, user
, and monthly cumulative totals) in a reproducible repo.Lakebase Cost Overview.lvdash.json
or deploy via Databricks Asset Bundles—complete with filters, trends, monthly rollups, price bands, and a 7-day anomaly lens.system.billing.usage
, system.billing.list_prices
, and system.access.workspaces_latest
USE CATALOG catalog_name; -- TODO: Replace with your catalog name
CREATE SCHEMA IF NOT EXISTS schema_name; -- TODO: Replace with your schema name
CREATE OR REPLACE VIEW catalog_name.schema_name.usage_daily_user_instance AS
SELECT
SUM(usage_quantity) AS compute_qty,
CAST(usage_date AS DATE) AS usage_date,
sku_name,
usage_unit,
usage_metadata.database_instance_id AS database_instance_id,
COALESCE(identity_metadata.run_as,
identity_metadata.created_by,
identity_metadata.owned_by) AS user,
workspace_id
FROM system.billing.usage
WHERE sku_name IN (
'PREMIUM_DATABASE_SERVERLESS_COMPUTE_US_EAST',
'PREMIUM_DATABRICKS_STORAGE_US_EAST'
)
GROUP BY
CAST(usage_date AS DATE),
sku_name,
usage_unit,
usage_metadata.database_instance_id,
COALESCE(identity_metadata.run_as, identity_metadata.created_by, identity_metadata.owned_by),
workspace_id;
Daily Cost by Unit
Cost Share by Database Instance
CREATE OR REPLACE VIEW catalog_name.schema_name.effective_rates AS
SELECT
CASE
WHEN sku_name = 'PREMIUM_DATABRICKS_STORAGE_US_EAST'
THEN pricing.effective_list['default']
ELSE pricing.effective_list['default']
END AS effective_rate,
usage_unit,
sku_name,
account_id,
currency_code,
price_start_time,
COALESCE(price_end_time, TIMESTAMP '2999-12-31 23:59:59Z') AS price_end_time
FROM system.billing.list_prices
WHERE sku_name IN (
'PREMIUM_DATABASE_SERVERLESS_COMPUTE_US_EAST',
'PREMIUM_DATABRICKS_STORAGE_US_EAST'
);
Effective Price over Time (per SKU)
CREATE OR REPLACE VIEW catalog_name.schema_name.workspaces AS
SELECT DISTINCT workspace_id, workspace_name
FROM system.access.workspaces_latest;
CREATE OR REPLACE VIEW catalog_name.schema_name.cost_lakebase_daily_accum AS
WITH comp_qty AS (
SELECT * FROM catalog_name.schema_name.usage_daily_user_instance
),
rate AS (
SELECT * FROM catalog_name.schema_name.effective_rates
),
workspace AS (
SELECT * FROM catalog_name.schema_name.workspaces
)
SELECT
w.workspace_name,
c.compute_qty * r.effective_rate AS cost,
c.usage_date,
TRUNC(c.usage_date, 'MONTH') AS month,
c.usage_unit,
r.currency_code,
c.database_instance_id,
c.user,
SUM(c.compute_qty * r.effective_rate) OVER (
PARTITION BY w.workspace_name, c.user, c.database_instance_id, r.currency_code, c.usage_unit,
TRUNC(c.usage_date, 'MONTH')
ORDER BY c.usage_date
ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
) AS accum_cost
FROM comp_qty c
JOIN rate r
ON c.sku_name = r.sku_name
AND c.usage_unit = r.usage_unit
AND TIMESTAMP(c.usage_date) >= r.price_start_time
AND TIMESTAMP(c.usage_date) < r.price_end_time
JOIN workspace w
ON w.workspace_id = c.workspace_id;
Potential Spikes (> 1.25× MA7)
Daily Cost vs 7-Day Moving Average
Cumulative Cost (All Units) - Monthly Window
CREATE OR REPLACE VIEW catalog_name.schema_name.cost_lakebase_by_workspace_monthly AS
SELECT
month,
workspace_name,
usage_unit,
currency_code,
SUM(cost) AS monthly_cost,
MAX(accum_cost) AS month_end_accum_cost
FROM catalog_name.schema_name.cost_lakebase_daily_accum
GROUP BY ALL;
Monthly Cost by Workspace
Region-agnostic option: replace the two
sku_name IN (...)
filters with
sku_name LIKE 'PREMIUM_DATABASE_SERVERLESS_COMPUTE_%'
OR sku_name LIKE 'PREMIUM_DATABRICKS_STORAGE_%'
https://github.com/dediggibyte/diggi_lakebase.git
To be considered: Point datasets at the views above if you changed catalog/schema. If you iterate visually, Export again and commit the updated JSON to your repo so your bundle stays the source of truth.
Databricks Lakebase offers a flexible, pay-as-you-go pricing model that scales with your needs. By understanding the core components — compute (DBUs), storage (DSU), and other costs you can accurately estimate and optimise your costs. Always refer to the official Databricks pricing page and use the calculator for the most up-to-date rates and personalised estimates.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.