Wiki: How I Built Klarna’s Experimentation System, and a LISP

For agents: Markdown version · Wiki index · Explore

Written by an LLM from machine transcripts. It can contain errors. Check the transcript before you quote it.

Summary

The speaker shares their experience of building a robust A/B testing and experimentation system from scratch at a major fintech company. They discuss the architectural challenges of avoiding single points of failure, scaling across numerous programming languages, and maintaining ultra-low latency under heavy traffic. To solve these problems, the speaker details a distributed, client-side approach utilizing persistent hashing and a custom hierarchical data model resembling a compiler. Ultimately, the audience learns how to design high-performance internal infrastructure by treating system configuration as a compiled language.

Key points

  • 4:15 The speaker introduces the core mechanics of an experimentation system and points out the lack of reference material on how to build one.
  • 5:15 A naive centralized service creates a massive single point of failure and database bloat as traffic multiplies.
  • 7:17 The constraints in a financial company require supporting multiple programming environments while guaranteeing sub-millisecond latency.
  • 9:23 The solution is to build the experimentation system as a client-side library or distributed local service rather than a central database-backed API.
  • 12:26 Persistent hashing allows the system to determine user experiment buckets deterministically without storing user states in a database.
  • 15:30 Audience segmentation is handled by a custom, safe restricted language called HyperMatch that prevents infinite loops.
  • 17:33 A hierarchical data model containing groups, layers, experiments, and variates allows safe parallel execution of multiple experiments.
  • 20:35 Unlike typical software development, experimentation systems require early optimization and absolute resilience from day one to ensure data integrity.

Takeaways

  • Avoid central database dependencies for high-frequency infrastructure by using persistent hashing to compute state on the fly.
  • Treat complex hierarchical configurations as a formal language and compile them into an in-memory AST for maximum performance.
  • Recognize that experimentation infrastructure cannot rely on a standard MVP approach and must guarantee data integrity and resilience from day one.

Questions this talk answers

  • How do you run A/B testing across multiple different programming languages without maintaining separate SDK logic for each one?
  • How can an experimentation platform achieve sub-millisecond latency without relying on a centralized database for user state?
  • What is the best way to structure experiment configurations to prevent conflicting overlapping experiments?

Technologies

JavaScript, Node.js, V8, Python, Java, Scala, Erlang, Haskell, Ruby, React Native, AWS S3

Tags

a/b testing, architecture, compilers, distributed systems, microservices, performance