flâneur — a map of the web's best reading

Every query gets a receipt - The Consensus

theconsensus.dev · 2,211 words · saved by 1 readers

You are getting early access to this article as a subscriber. Your support makes articles like this possible. Thank you. Modern databases offer plenty of tools to observe the system after the fact of degradation or overload: slow query logs, EXPLAIN, performance_schema. These tools are typically executed by humans as they investigate issues. All of them require issuing extra queries, and sometimes are not even safe to perform frequently in production. At the same time, when building an externally-facing API that lets clients query the data in any shape, you’ll want to surface patterns that exhaust your database resources. Surface faster than it takes to start causing production impact and for an SRE to wake up and run some EXPLAINs. Add multi-tenancy on top of that, and hard limits like “max N requests per minute” on the API endpoint no longer stand well. You need a way to figure how expensive the actual query was, the moment it executes – and ideally with minimum overhead. We’ll focus

databases Every query gets a receipt MySQL audit plugins provide a way for downstream services to record cost per API call in a way you might struggle to safely do with slow query logs and EXPLAIN. By Kir Shatrov · March 20, 2026 You are getting early access to this article as a subscriber. Your support makes articles like this possible. Thank you. Modern databases offer plenty of tools to observe the system after the fact of degradation or overload: slow query logs , EXPLAIN, performance_schema . These tools are typically executed by humans as they investigate issues. All of them require issu

Explore this link on the map →

saved by

related reading