Every query gets a receipt - The Consensus
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
saved by
related reading
- Everything I know about good system designseangoedecke.com
- A More Human Approach To Databasesccorcos.github.io
- Logging, Tracing, Monitoring, et al.alexandruburlacu.github.io
- Making 768 servers look like 1 — PlanetScaleplanetscale.com
- Scaling PostgreSQL to power 800 million ChatGPT users | OpenAIopenai.com
- The startup's Postgres survival guidehatchet.run
- DBMS Musings: It’s Time to Move on from Two Phase Commitdbmsmusings.blogspot.com
- Why We Don’t Trust the Database With Authentication – Sturdy Statisticsblog.sturdystatistics.com
- Against SQLscattered-thoughts.net
- We replaced Redis with MySQL for inventory reservations—and it scaled (2026) - Shopifyshopify.engineering
- All you need is Wide Events, not “Metrics, Logs and Traces”isburmistrov.substack.com
- A beginner's guide to ACID and database transactions - Vlad Mihalceavladmihalcea.com