How Uchi.ru built an A/B test analysis platform on ClickHouse

Fedor Tyurin23 Jan 2023

Problem

Uchi.ru, a school platform, runs dozens of A/B tests a week and hundreds a year. Its first analysis tool was a simple script from the early days. As teams multiplied, each defined its own metrics and success criteria, so nobody outside a team could read its past results. Adding a function meant hacks, and teams wrote their own testers. The tool ignored network effects, could not compute cumulative metrics quickly, and let product managers look for confirmation of their hypotheses.

Example from the article: competitions are tested for a whole class, so a child's behavior depends on classmates, yet the team needs per-student conversion and time on the platform.

Solution in brief

The team built one platform on ClickHouse. A Python backend turns the user's choices into one SQL query, ClickHouse does the heavy calculation over a single wide metrics table, and the backend only finalizes a compact result. The test is chosen from the metric type and the unit of analysis, and the interface nudges users toward correct decisions.

Questions this case answers
  • How to analyze experiments centrally when the randomization unit is a group but the metrics are defined per member
  • How to compute day-by-day cumulative test statistics at scale inside the analytical database instead of application code
  • How to build safeguards into an experiment-analysis tool so non-expert users do not inflate the false-positive rate
  • How to replace several team-specific A/B analysis scripts with one platform that every product team uses?

Tools and methods

  • ClickHouse — runs the heavy calculations inside the database
  • Python backend — builds the SQL query, finalizes results
  • Delta method — test when the analysis unit is smaller than the randomization unit
  • t-test, z-test — continuous and binomial metrics, units match
  • Multiple testing correction — applied automatically for several groups, metrics or segments
  • MDE calculator — fixes the test duration before launch
Continue reading — it's free

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