Skip to content

How we merged five embedded Databricks dashboards into one

Andrey TaranUpdated 5 min readVoices

After the first weeks of use, a client's feedback on its portal kept coming back to the wait between reports. So we replaced the five embedded dashboards in the portal with one AI/BI dashboard. The numbers were right and each board was fast enough. Every switch between boards still cost the user a new embed token, a new iframe and a new round of queries.

Until then every one of the five reports was its own dashboard, embedded in the portal one at a time. That's how the reports had arrived from the Power BI days, one file per report, and we'd rebuilt them the same way without asking whether the split still made sense. Part 2 had already made each board fast with its rule of one row-level dataset per dashboard.

Caching harder would have sped up the queries and left the shell alone, and the shell was the part users felt.

Five reports, five iframes

We deliver the AI/BI dashboards inside the client's portal through external embedding, and an embedded dashboard is an iframe. When a user switched from the sales report to the titles report, the portal asked our backend for a new embed token. Databricks rendered the dashboard shell from scratch under the service principal, and the datasets ran again. Databricks caches query results, so a second visit was quicker, but the shell still loaded. And the reports were reading the same two views anyway. A user paid a full page load to look at the same data from a different angle.

Portal

Embed token per report

Five iframes, five shell loads

Datasets run on every switch

One embed token

One dashboard, five sections

One global filter bar

Shared base query, warmed once

One dashboard with five sections replaces five embedded dashboards, so a report switch becomes a scroll instead of a new token, a new iframe and a new round of queries.

One dashboard, one filter bar

The fix didn't need a new feature. We put all five reports on one dashboard and one canvas, each report as a section, under a single global filter bar for the date range, the client and the state. Every remarketing dataset on the board opens with the same base query, the same join to the tenant scope table and the same four filters. So one filter change drives every section, and the shared client and state lists warm once. The five report builders kept their tested SQL, and the combined builder only reuses it.

What the user sees changed more than the SQL did. There's one embed token, one shell load and one filter bar, and all five reports sit one scroll apart. Today that board carries 18 datasets, and part 2 explains why it's 18 and not one.

What stayed separate

The benchmark report didn't join the combined board. It reads a different fact table, and merging it would have dragged its own datasets into every load of five reports that don't need them. That gave us the rule we now apply to new reports. Group dashboards by the fact table they read, not by the report name. If two reports read the same base, they belong on the same board. If they read different facts, separate boards are cheaper for everyone.

Pages, the experiment we reverted

AI/BI dashboards also have pages, rendered as tabs, and a dashboard runs only the datasets of the active page. We used that to make the raw-rows table lazy. The table moved to its own page, the board opened with charts only, and the row query fired the first time the tab was opened. The query counts confirmed it. On the titles board the initial load issued four queries without the rows dataset, and opening the tab issued two more.

We reverted it. Splitting the table from the charts put the rows one tab away from the numbers they explain, and the product owner preferred the table under the charts, loaded with them. The transform script stayed in the repository in case the trade-off is ever decided the other way. Pages are a real lever for load time, but they aren't free for the reader.

What the merge costs

  • The portal drives filters through the embed URL, with one parameter per page and widget. Those native filter widgets have to stay on the canvas with stable page and widget names, even though the portal clips that header and renders its own filter controls. Renaming a page breaks every binding the backend holds.
  • The rows preview and the complete CSV on the combined board are mixed-domain. Sold remarketing records and recent title activity share one list, so there's no single headline total that the rows add up to, and the export contract has to say so.
  • One board means one blast radius. A broken dataset now takes five reports down instead of one, which is why CI diffs every generated artifact against the committed one before it can be published.

Where it stands

The client's original ticket asked for "dynamic query and filter options", and one board serves that better than five did. The request reads differently when every report answers to the same filter bar and sits one scroll away. The series started with a Lakehouse Federation demo in Part 1, and the combined board is one more step in moving the application's client reporting onto Databricks. The next part is about the client's request for real time, what it costs on a live database, and the compromise we settled on.

Frequently asked questions

Do portal users need Databricks accounts to see an embedded dashboard?

No. External embedding authenticates the portal's backend as a service principal, which then mints a narrower token for each viewer, so nobody is provisioned in Databricks (external embedding). Row-level scoping comes from an external_value that dataset queries read as __aibi_external_value, and a separate external_viewer_id goes to the audit log and must not carry personal data. The two values together are capped at 1 KB.

Is there a limit on how many embedded dashboards can load at once?

Yes. External embedding allows 20 dashboard loads per second, and more than 20 can be open as long as no more than 20 load at the same moment. Five separate boards spent a load on every report a user switched to, where the combined board spends one per visit, so the merge also leaves more room under that limit on a busy morning.

Can users ask Genie questions inside an embedded dashboard?

Not when the viewers are external users. Ask Genie isn't supported in external embedding, and Databricks points to the Genie Conversation API for that case. A portal that wants questions in plain language next to its reports builds that conversation itself against the API, with the same service principal model behind it.