Quick revision
The short answer
We standardise what every database reports and how it is presented, not the internals of each engine: the same golden signals (latency, throughput, errors, saturation of CPU, I/O, connections and storage, and replication health) with the same labels for team, service and environment, collected by standard exporters into one metrics backend. Query-level insight, centrally collected and masked slow query logs, templated dashboards and runbooks per engine, and SLO-based alerts complete the standard.
What to remember
In this answer, we designed an observability standard for 200 databases. We defined engine-neutral golden signals and mapped them per engine, collected them through standard exporters and managed integrations into one backend with mandatory labels, added query-level insight and centrally collected, sampled and masked slow query logs, and built templated dashboards, runbooks and SLO-based alerts, all installed automatically by the platform so the standard spreads without extra work for teams.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
We standardise what every database reports and how it is presented, not the internals of each engine: the same golden signals (latency, throughput, errors, saturation of CPU, I/O, connections and storage, and replication health) with the same labels for team, service and environment, collected by standard exporters into one metrics backend. Query-level insight, centrally collected and masked slow query logs, templated dashboards and runbooks per engine, and SLO-based alerts complete the standard.
Why this question is asked
With 200 databases across several engines, the worst situation for on-call is that every database is a puzzle: a different dashboard, different metric names, a runbook that is three years old or missing. People then diagnose by asking whoever built the database, which does not scale and fails at night. Interviewers ask this design question to see whether we can find the common layer across very different systems and make it cheap for every team to adopt. In this answer, we will define the common signals, choose how they are collected and labelled, add query-level insight and slow query logs, and then turn it all into templated dashboards, runbooks and SLO-based alerts.
1Choosing Signals That Mean the Same Thing Everywhere
The golden signals are four questions we can ask of any service: how long requests take (latency), how many there are (throughput), how many fail (errors), and how close the system is to its limits (saturation). For a database, saturation splits into CPU, disk I/O, connections against their limit, and storage used against capacity. We add one more family for databases: replication health, meaning lag and whether every expected replica is connected.
The trick is to define each signal once, in engine-neutral terms, and then map it per engine. 'Connections used ratio' is current connections divided by the limit; PostgreSQL gets it from pg_stat_activity and max_connections, MySQL from Threads_connected and max_connections, and a managed NoSQL store from its own throttling or capacity metrics. The on-call engineer sees db_connections_used_ratio for every database and does not need to remember which engine calls it what.
| Standard signal | PostgreSQL | MySQL | Managed NoSQL |
|---|---|---|---|
| query latency p95 | pg_stat_statements, exporter | Performance Schema digests | provider latency metric |
| throughput | xact_commit rate | Questions or Com_* rate | read and write request rate |
| errors | rollbacks, deadlocks, failed logins | Aborted_connects, errors | throttled and failed requests |
| connections used ratio | connections / max_connections | Threads_connected / max | consumed / provisioned capacity |
| storage used ratio | data size / volume size | data size / volume size | table size / quota |
| replication lag | replay lag seconds | replica lag seconds | global table lag if used |
2Collection and Labels
For self-hosted PostgreSQL and MySQL we use standard exporters, such as postgres_exporter and mysqld_exporter for Prometheus or the OpenTelemetry collector's database receivers, deployed by the same automation that creates the database. For managed services we use the provider integration that exports their metrics. Everything lands in one metrics backend, so a single query can compare all 200 databases.
Labels are what make the data useful. Every series carries the same mandatory labels: engine, team, service, environment, region and tier (how critical it is). These come from the inventory, not from people typing them, so they are always present and spelled the same way. With them, the on-call engineer can filter to 'all production databases of the payments team' and see at once which one is unusual. A database without labels shows up on a 'not compliant' panel, which is the gentle pressure that keeps the inventory complete.
3Query-Level Insight and Slow Query Logs
Golden signals tell us that a database is slow; query-level data tells us why. For PostgreSQL that is pg_stat_statements, for MySQL Performance Schema statement digests, and on managed services tools such as Amazon RDS Performance Insights or Cloud SQL Query Insights. The standard says this must be enabled everywhere and that query statistics are kept for at least a few weeks, because the most useful question during an incident is 'what changed since last Tuesday', and that needs history to compare against.
Slow query logs add the individual statements above a threshold, such as 500 ms. They are shipped centrally with the database labels. Two rules apply. Sampling keeps volume under control on busy databases: log every query above the threshold, but only a sample of those just under it. PII masking matters because slow query logs contain literal values, which may be email addresses or account numbers; the collector replaces literals with placeholders before the logs leave the host, or we rely on normalised query text where the engine provides it.
4Templated Dashboards, Runbooks and SLO Alerts
Each engine gets one dashboard template, generated from code and parameterised by the database's labels. All templates share the same layout: golden signals at the top in the same order, then engine-specific panels below. An engineer who has used the PostgreSQL dashboard can find their way around the MySQL one in seconds. Each runbook follows the same structure too: what this alert means, how to confirm it, the first three things to check, and how to escalate, with links straight from the alert.
Alerts are tied to service level objectives rather than raw thresholds. A raw threshold such as 'CPU above 80 percent' pages people for batch jobs that are harmless. An SLO says what users need, for example 99.9 percent of queries for this service under 100 ms, and the alert fires when the error budget is burning too fast. We keep a few saturation alerts that predict outages, such as storage that will be full within 48 hours, because those do not show up in latency until it is too late.
- Alerts and runbooksSLO burn rates plus a few predictive saturation alerts
- Dashboardsone template per engine, same layout for golden signals
- Query insight and slow logspg_stat_statements, Performance Schema, masked logs
- Metrics backendone store, mandatory labels from the inventory
- Collectionstandard exporters and managed integrations, deployed automatically
5 layers, from the top down. Step through them one at a time.
5Rolling It Out to 200 Databases
A standard that needs each team to do work will spread slowly. So we make the platform do it: the provisioning pipeline installs exporters, enables pg_stat_statements or Performance Schema, applies labels and creates dashboards and alerts for every new database. For the existing fleet, we ship it in waves by tier, starting with the most critical databases, and track coverage on a page that shows each database's compliance.
We then measure whether it works by the outcome on-call cares about: time from page to diagnosis. If that number drops across engines, the standard is doing its job.
6Follow-up questions
Why not just use each engine's native monitoring tool?
Native tools are often excellent for deep work and we keep them for experts. But on-call engineers need one place and one vocabulary at 3 a.m., and comparisons across databases need a single backend. The native tools sit behind the standard, linked from the dashboards.
How do you keep metric cardinality under control?
We avoid labels with unbounded values, such as query text or user id, on metrics. Per-query data lives in the query insight tools and logs, which are designed for it, while metrics keep a bounded set of labels from the inventory.
What about engines that do not expose a given signal?
The standard marks the signal as not available for that engine and the dashboard says so, rather than showing an empty graph. If a signal matters for diagnosis, such as replication lag, we may write a small probe that measures it directly.
7Conclusion
In this answer, we designed an observability standard for 200 databases. We defined engine-neutral golden signals and mapped them per engine, collected them through standard exporters and managed integrations into one backend with mandatory labels, added query-level insight and centrally collected, sampled and masked slow query logs, and built templated dashboards, runbooks and SLO-based alerts, all installed automatically by the platform so the standard spreads without extra work for teams.
Open with
I would standardise the vocabulary and the presentation, not the engines. First, a set of golden signals every database must report: latency, throughput, errors, saturation as CPU, I/O, connections and storage, plus replication health.
Then, if they want more
Each signal has one engine-neutral name and definition, and we map it per engine, so connections used ratio means the same thing for PostgreSQL, MySQL and a managed NoSQL store. Collection uses standard exporters or provider integrations, deployed automatically, into one metrics backend, and every series carries mandatory labels from the inventory: team, service, environment, region and tier.
For the why behind a slowdown, query-level insight must be enabled everywhere, pg_stat_statements, Performance Schema or Performance Insights, with a few weeks of retention so we can compare with last week. Slow query logs go to a central store with sampling and with literals masked so we do not leak personal data.
On top of that, one dashboard template and one runbook structure per engine with the same layout, and alerts based on SLO burn rates plus a few predictive ones like disk full in 48 hours. The platform installs all of it, and I would judge success by time to diagnose.
About this answer
- Last updated
- 12 November 2026
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
- Official documentation
- PostgreSQL documentation, MySQL reference manual
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "Define a database observability standard for 200 databases (PostgreSQL, MySQL and some...": https://scrivio-interview-library.netlify.app/databases/database-operations/66612f0caf/