Summary: What The Heck Is the Metrics Layer by Pedram Navid
How dbt, Looker and Lightdash implemented metrics layer and trade-offs behind it
Original article: Deep Dive: What The Heck Is the Metrics Layer by Pedram Navid (September 2022)
Motivation: the author explains what is the metrics layer, how it works, how to use it, and various trade-offs in how various tools have implemented it.
The metrics layer aims to standardize the way metrics are defined and used across different tools and platforms. In 2021, headless BI solutions started exploring ways to unbundle metrics from the BI layer. In dbt, the metrics layer eventually transitioned to the semantic layer. Benn Stencil made a case for the metrics layer. Amit Prakash's explained the metrics layer well and described six classes of metrics and three potential solutions for implementing a semantic layer.
Example metric: activation rate
The "activation rate" measures the ratio of active workspaces to all workspaces in a B2B SaaS platform. The activation rate is defined and calculated using SQL as a baseline, which works well initially but becomes cumbersome when stakeholders request aggregated data at different time granularities.
Metrics Layer to the rescue
Pedram explains three implementations of the metrics layer: Looker, dbt metrics layer, and Lightdash.
Looker has a syntax-aware UI that simplifies the development experience and can dynamically generate SQL based on user-defined metrics. However, it is tightly integrated within the Looker ecosystem, and its high entry price can be prohibitive for smaller companies.
dbt metrics layer still faces challenges in providing an ergonomic and performant solution, as well as the lack of development tooling and gaps in features. The active development and lack of stability make it difficult to recommend at the time of writing.
Lightdash is a BI tool that integrates with dbt. It offers two ways of expressing metrics: using the native dbt metrics layer and its own metrics implementation with additional benefits, incl. joins and formatting. However, any changes to metrics require a full dbt refresh. Lightdash's reliance on dbt may also pose challenges in terms of stability and future development.
Core message & CTA
Pedram weighs the trade-offs and strengths of each tool, acknowledging the increased interest in a universal metrics layer solution. dbt is well-positioned to become the standard for a metrics layer due to its wide adoption. He raises the question of whether a metrics layer can be universal enough to be applicable across the data stack while still being relevant to BI tools. The answer is still uncertain, but the ongoing development of a standardized metrics layer is promising.