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
Explore this link on the map →saved by
related reading
- Everything I know about good system designseangoedecke.com
- Databases are Fucking Stupid | Probably Danceprobablydance.com
- Against SQLscattered-thoughts.net
- Building data-centric apps with a reactive relational databaseriffle.systems
- Introducing Husky, Datadog’s third-generation event store | Datadogdatadoghq.com
- The most useful Postgres extension: pg_stat_statements - Citus Datacitusdata.com
- Logging, Tracing, Monitoring, et al.alexandruburlacu.github.io
- pthorpe92.devpthorpe92.dev
- Incremental Database Computationsfeldera.com
- Databases in 2024: A Year in Review // Blog // Andy Pavlo - Carnegie Mellon Universitycs.cmu.edu
- Cleaned-up transcript of Rich Hickey's talk "Deconstructing the Database" · GitHubgist.github.com
- Nine ways to shoot yourself in the foot with PostgreSQLphilbooth.me