Database monitoring is the practice of tracking the signals that show whether a production database is healthy, degrading, approaching a limit, or losing its ability to recover safely.
For a small team, effective database monitoring does not mean collecting every metric. It means connecting customer impact → database behavior → action → recovery confirmation with as little noise as possible.
Raff Technologies supports both managed and self-hosted database operating models. Managed Databases can reduce the amount of host- and engine-level monitoring work a team must operate itself, while a database on a Raff VM gives deeper control and makes the team responsible for the complete monitoring stack.
The monitoring model should answer five questions quickly:
- Are users or critical jobs affected?
- Which database behavior is most likely causing the impact?
- Is the condition stable, recovering, or getting worse?
- Does the team still have enough capacity and recovery coverage?
- Who owns the response, and what proves recovery?
Database monitoring should start with customer impact
A database can report normal CPU and memory while users are seeing timeouts, blocked transactions, stale reads, or failed background jobs.
That is why production monitoring should begin with application behavior and then work inward toward the database cause.
| Monitoring layer | Primary question | Useful signals |
|---|
| User impact | Can customers complete database-dependent work? | Request success, transaction latency, job failures, connection wait time |
| Workload behavior | What is the database doing? | Slow queries, lock waits, long transactions, query errors |
| Capacity | Is the database approaching a practical limit? | Connections, storage growth, CPU, memory pressure, I/O latency |
| Continuity | Can another path keep service running? | Replica health, lag, failover readiness |
| Recovery | Can the team recover correct historical data? | Backup age, PITR/log continuity, restore-test evidence |
The most useful alert pairs customer impact with enough database context to guide the first safe action.
Database performance monitoring needs workload context
Database performance monitoring is more useful when it explains why application work is becoming slower or less reliable, rather than simply showing resource percentages.
Start with these workload questions:
- Are critical requests slower than their normal baseline?
- Are more queries failing?
- Are applications waiting for database connections?
- Are a small number of query families consuming most execution time?
- Are lock waits or long transactions blocking useful work?
- Is storage or I/O becoming the bottleneck?
- Did performance change after a deployment, migration, or traffic shift?
A practical performance-monitoring path is:
Application latency or errors
-> connection availability
-> query behavior
-> locks / transactions
-> CPU / memory / I/O / storage
-> recent deploy or migration
-> owned response
This order prevents teams from treating high CPU as the diagnosis when it may only be the symptom of a query regression, lock storm, connection surge, or maintenance task.
Connection monitoring should protect headroom before exhaustion
Database connection exhaustion can make a healthy database appear unavailable to the application.
Track:
- configured connection limit;
- active connections;
- idle connections;
- waiting or rejected connections;
- idle-in-transaction sessions;
- pool size per application component;
- connection acquisition latency;
- connection age;
- administrative reserve.
Plan total connection demand across the whole application:
application instances × pool size
+ workers
+ scheduled jobs
+ migrations
+ monitoring sessions
+ admin reserve
= planned connection demand
The common failure is increasing pool sizes independently across services until the database becomes the shared bottleneck.
More connections do not automatically create more throughput. They can increase memory use, lock pressure, queueing, and context switching.
A useful connection alert should answer:
- are users waiting for connections now?
- which service is consuming the pool?
- is demand caused by traffic growth, a leak, autoscaling, or long transactions?
- how much administrative headroom remains?
Slow-query monitoring should measure total workload impact
A query is operationally important when it is slow enough, frequent enough, or blocking enough to affect the service.
Monitor normalized query families by:
- execution count;
- total execution time;
- mean and percentile latency where available;
- rows processed versus rows returned;
- temporary work or spills;
- lock-wait time;
- plan changes;
- endpoint, worker, or job generating the query where available.
A one-second query that runs once per day can matter less than a 40 ms query executed hundreds of thousands of times. Conversely, one long migration or reporting query can block production even when its execution count is one.
The useful question is therefore not simply “Which query is slow?” It is “Which query family is consuming or blocking the most useful work?”
Locks and transaction age reveal stalls that CPU graphs can miss
Track:
- waiting sessions;
- blocking sessions;
- deadlocks;
- long-running transactions;
- idle-in-transaction age;
- migration duration;
- lock-wait duration.
A lock alert should show both the waiter and the blocker where possible.
The response also needs a safe decision path. Terminating a blocker can roll back a large transaction, increase I/O, or create application errors. A runbook should define who can authorize that action and what must be checked first.
Long-lived transactions are especially useful early-warning signals because they can create lock risk, delay cleanup, complicate schema changes, and increase recovery or maintenance work before CPU becomes obviously abnormal.
Capacity monitoring should use headroom and rate of change
A single percentage threshold is rarely enough for database capacity.
| Capacity area | Monitor | Better question |
|---|
| CPU | Sustained utilization + workload change | Is useful demand rising, or did a query regress? |
| Memory | Pressure, swapping, per-session demand | Can current concurrency fit safely? |
| Storage | Free space + growth rate | How long until capacity becomes unsafe? |
| I/O | Latency, queueing, waits | Is storage becoming the bottleneck? |
| Connections | Usage + wait/rejection rate | How much safe concurrency remains? |
A database at 70% storage utilization and growing 0.1% per month is a different operational problem from one at 70% and growing 2% per day.
Capacity planning should also include temporary requirements from:
- index builds;
- schema migrations;
- restores;
- large imports;
- transaction-log growth;
- maintenance;
- replica catch-up.
Classify responses by urgency:
- Page — user impact exists or a hard limit is imminent.
- Urgent ticket — a safe boundary will be crossed soon.
- Scheduled review — growth is predictable and there is time to resize or optimize deliberately.
Replication monitoring should reflect the replica's role
Replication lag has different meaning depending on why the replica exists.
| Replica role | Monitoring risk |
|---|
| Read scaling | Users may receive stale results |
| Analytics | Reports may operate on delayed data |
| Failover | Promotion may expose a larger data-loss window |
| Recovery feed | Recovery coverage may degrade |
| Maintenance standby | Planned switchover may take longer |
Monitor whether the replica is:
- connected;
- receiving changes;
- applying changes;
- recovering lag after a spike;
- retaining excessive logs because it cannot keep up.
Thresholds should follow the product requirement. Five minutes of lag may be acceptable for analytics and unacceptable for permissions, subscriptions, billing, or inventory.
Do not treat a connected replica as automatically safe for failover. Promotion also depends on replay position, expected data loss, client routing, fencing, capacity, and application reconnect behavior.
For the availability-versus-history distinction, use PostgreSQL Replication vs Backups vs Snapshots.
A database can be performing perfectly while its recovery path is silently failing.
Track recovery-readiness signals such as:
- last successful backup time;
- age of the newest usable recovery point;
- expected backup interval;
- WAL, binary-log, or other transaction-log continuity where PITR is required;
- retention status;
- backup access or credential failures;
- backup-size anomalies;
- last successful restore-test date;
- measured restore duration;
- measured RPO and RTO from the last drill;
- application validation result.
A green backup job proves that a backup process completed. It does not prove that the recovery point is usable or that the database can return within the required RTO.
Separate two types of recovery monitoring:
- Recovery coverage alert — act quickly when backup or log continuity is broken and the approved RPO is at risk.
- Recovery evidence alert — create follow-up work when restore testing is stale or measured recovery is approaching the approved RTO.
Use Database Backup Strategy for SaaS Apps for recovery design and Database Restore Testing: RPO, RTO, and Recovery Validation for the detailed restore-testing framework.
Database monitoring metrics should map to actions
A compact production metric set is more useful than a large dashboard nobody owns.
| Signal | Why it matters | Typical action path |
|---|
| Application DB error rate | Direct customer impact | Inspect connection, query, and dependency failures |
| Connection wait/rejection | Capacity or pool failure | Identify consuming service, leak, or pool sizing issue |
| Query latency / total time | Performance regression | Identify query family and recent change |
| Lock wait / transaction age | Concurrency stall | Find blocker and evaluate safe intervention |
| Storage headroom | Hard capacity risk | Resize, clean, or change growth plan |
| I/O latency | Storage bottleneck | Identify workload or storage pressure |
| Replication lag | Freshness/failover risk | Determine whether secondary still satisfies its role |
| Backup/PITR continuity | Recovery-point risk | Repair recovery chain |
| Restore-test age | Recovery confidence | Schedule and execute validation |
This metric set should be adapted to the engine and workload. It is not a universal threshold template.
Database alerts should protect the team's attention
Small teams should classify alerts before creating them.
| Alert class | Meaning | Expected response |
|---|
| Page | Active user impact or immediate data/recovery risk | Respond now |
| Urgent ticket | Rapidly approaching safe limit | Resolve in a defined window |
| Scheduled review | Trend or maintenance concern | Review during operations cycle |
| Dashboard only | Investigation context | No standalone response |
| Recovery evidence | Proof of backup/restore readiness | Retain and review periodically |
Every paging alert should include:
- affected service and environment;
- customer or job impact;
- current value and recent baseline;
- likely correlated causes;
- owner and escalation path;
- first safe diagnostic action;
- runbook link;
- recovery confirmation criteria.
Review alerts after incidents and false positives. Remove alerts that do not lead to a decision, merge duplicate symptoms, and do not suppress customer-impact signals simply because maintenance is scheduled.
Searches for database monitoring tools often mix several different needs: engine metrics, query analysis, application tracing, infrastructure telemetry, alert routing, and managed-service visibility.
A monitoring stack may combine:
- database-native statistics and logs;
- infrastructure metrics;
- application performance monitoring or tracing;
- centralized logs;
- query-performance views;
- alert routing;
- managed database telemetry;
- restore and backup evidence.
Choose tooling only after defining what must be detected and who acts on it.
Evaluate a database monitoring tool or platform against questions such as:
- Can it correlate database behavior with application impact?
- Does it expose connection, query, lock, capacity, and replication signals relevant to the engine?
- Can the team alert on rates of change, not only fixed thresholds?
- Can it distinguish page-worthy incidents from trend review?
- Can responders see enough context without jumping across many dashboards?
- Does it support the ownership and runbook model the team actually uses?
- Can recovery-readiness signals be monitored somewhere in the same operating process?
The best monitoring architecture is not the one with the most charts. It is the one that helps the team recognize important conditions early and make the correct decision quickly.
Managed databases reduce some monitoring work, not all monitoring responsibility
With a managed database, more host- and engine-level collection, maintenance, backup infrastructure, and service telemetry can sit inside the provider boundary.
The application team still needs to monitor:
- customer transaction success;
- workload-specific latency;
- application connection behavior;
- query and endpoint behavior;
- migration impact;
- capacity decisions;
- business validation after failover or restore;
- whether the current service capabilities still meet RPO and RTO requirements.
For Raff, compare the current Managed Databases, Managed PostgreSQL, Managed MySQL, and Managed Valkey pages for the live service boundary and available capabilities.
Product capabilities, engine availability, retention, monitoring features, and limits can change, so the live product page and console should remain the source of truth for production design.
Self-hosted database monitoring includes the full infrastructure stack
A database on a Raff VM gives the team full engine and operating-system control.
That also means the team owns:
- host metrics;
- database metrics;
- query and lock visibility;
- database logs;
- OS logs;
- backup monitoring;
- PITR/log-archive monitoring;
- replication monitoring;
- patch and certificate monitoring;
- alert routing;
- restore-test evidence;
- monitoring-system availability itself.
Raff Data Protection can support VM-level recovery where appropriate, but transactional database recovery should still use engine-aware backup and restore design when required by the workload.
This is why the managed-vs-self-hosted decision should compare total operational ownership, not only the infrastructure price.
Database monitoring checklist for small teams
Before treating the monitoring model as production-ready, confirm:
- Critical database-backed user workflows are monitored.
- Application error and latency signals can be correlated with database behavior.
- Connection wait, rejection, and headroom are visible.
- Important query families can be identified by total workload impact.
- Lock waits and long transactions are visible.
- Storage growth and capacity headroom are tracked.
- I/O and compute pressure can be distinguished from query or lock problems.
- Replication lag thresholds reflect the replica's actual role.
- Backup and PITR continuity are monitored where required.
- Restore-test age and measured recovery results are reviewed.
- Page, urgent-ticket, scheduled-review, and dashboard signals are separated.
- Every important alert has a named owner and first safe action.
- Managed-vs-self-hosted monitoring responsibility is explicit.
- Alerts are reviewed after incidents and false positives.
Conclusion
Database monitoring for small teams should connect customer impact to a compact set of performance, capacity, replication, and recovery signals.
Start with application success and latency. Then use connection availability, query behavior, locks, storage growth, I/O, replication lag, backup coverage, and restore evidence to explain what is happening and what should happen next.
Monitoring tools matter, but the operating model matters more. Managed databases can reduce platform-level monitoring and maintenance work, while self-hosting gives deeper visibility and control at the cost of owning the complete monitoring lifecycle.
Continue with Database Reliability for Small Teams, Database Backup Strategy for SaaS Apps, or Managed vs Self-Hosted Databases for the next decision layer.