OpenFGA reduced P99 tail latency by up to 98% using a self-tuning strategy planner based on Thompson Sampling. The system treats graph traversal as a multi-armed bandit problem, maintaining probability distributions for each traversal strategy and continuously learning from production latency. By encoding domain knowledge through carefully tuned Normal-Gamma priors, the planner balances exploration and exploitation, automatically adapting to changing data distributions. The solution uses lock-free atomic operations for concurrency and proved more robust than static heuristics in multi-tenant production environments.

12m read timeFrom auth0.com
Post cover image
Table of contents
The ProblemOur Approach: Why We Chose Thompson SamplingThe Art of the Prior: Encoding Domain KnowledgeProduction Results: Performance and the Self-Tuning ImpactTakeaways

Sort: