Engineering The Semantic Layer: Principles for Data at Scale

Sathiya Sarathi Gunasekaran6 Dec 2025

Problem

Raw warehouse tables hold placeholder prices, drafts and test records, so every analyst filters them in their own way. Revenue, active users and time grains end up defined differently per dashboard, and data scientists write separate SQL and cleaning before modeling. Filters, joins and CTEs are copy-pasted across projects, and nobody can govern them. The organization then depends on a few analysts and engineers to reconcile conflicting numbers, which slows analytics and ML work, because each discrepancy needs a manual reconcile by an analyst.

Example from the article: the post opens with two questions that teams still struggle to answer: "What was our revenue yesterday?" and "Why do different dashboards show different numbers?"

Solution in brief

Put business definitions (metrics, filters, exclusions, joins, calendars) into one governed semantic model, and let every tool request metrics from it instead of writing SQL against raw tables. The model compiles requests into SQL, so a change to a definition or a schema is made once and reaches all consumers. Mercari expresses it in LookML.

Questions this case answers
  • How to keep metric definitions consistent across many consumers when each team writes its own queries over raw tables
  • How to let non-technical users query governed metrics without knowing the underlying schema or writing SQL
  • How to make every dashboard and analyst report the same revenue number?
  • How to define a business metric once and reuse it in BI, notebooks, ML pipelines and AI agents?

Tools and methods

  • Semantic layer — one place for metric definitions, relationships and business rules, exposed to all consumers
  • LookML (Looker) — modeling language for measures, dimensions and joins, used in the post's examples
  • Business-policy to implementation mapping — stakeholders state what to count, the model encodes how
Continue reading — it's free

Google or a one-time email code. No password.