Metric computation for multiple backends

Craig Boucher, Ulf Knoblich, Dan Miller, Sasha Patotski, Amin Saied19 Dec 2020

Problem

An experimentation team needs hundreds or thousands of metrics, each with variance, confidence intervals and slices such as day of week or device type. Product data sits in different compute systems (called fabrics) and teams migrate between them. Hand-written queries in a fabric-specific language do not scale, are hard to keep trustworthy, and have to be rewritten after every migration. People with different backgrounds also want to add metrics.

Example from the article: Microsoft's Experimentation Platform (ExP) serves dozens of products (Bing, Office, Xbox, MS Teams, VS Code). Some teams have thousands of metrics and run hundreds of A/B tests a month.

Solution in brief

Metrics are written once in a fabric-agnostic domain-specific language (DSL) and parsed into a tree. A code generator adds variance, slicing and optimizations to the tree, then a thin emitter writes a script for the requested fabric. Metric authors do not touch statistics or fabric syntax.

Questions this case answers
  • How to compute a large, shared set of experiment metrics with correct statistics when data lives in several incompatible compute systems and many non-specialists define metrics
  • How to compute hundreds of A/B test metrics with correct variance and data slices without hand-writing queries for each one?
  • How to let data scientists, product managers and developers contribute metrics without breaking trustworthiness?
  • How to keep metric definitions when product data moves from one compute system to another?

Tools and methods

  • Metrics DSL — one-line, fabric-independent metric definitions over aggregation levels (page, session, user)
  • Metrics plan — compiled tree of tables and expressions, stored in a Metric Set Service
  • Code generator — transformers, factories and a naive emitter that produce a script per fabric
  • Delta method / standard variance — chosen automatically per metric (per the paper)
  • Apache Spark — one of the target fabrics (per the paper)
Continue reading — it's free

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