Cloud & Infrastructure

Your App Mental Model Makes Cloud Failures More Expensive

A backend developer can compare cloud prices down to the instance and still miss the expensive decision: who acts when a dependency is healthy on paper but unusable by the application? My position is that teams should buy operational responsibility per failure mode, not choose “managed” or “self-hosted” for an entire stack. The common mistakes are boundary mistakes, and their costs appear during incidents rather than procurement.

A cloud invoice does not tell you who owns the failure

The first mistake is treating “hosted by someone else” as an ownership assignment, because a provider can keep a database process running while your team remains responsible for schemas, credentials, query behavior, and recovery from deleted rows. Conversely, self-hosting does not mean writing every operational tool yourself, because PostgreSQL, systemd, and established backup software already provide substantial machinery. The decision is about the work left at the boundary.

Buying Cloud Infrastructure Means Owning the Hidden Maintenance Load is a useful warning, but I would resist treating every purchased service as the same maintenance burden, because a managed database contract may assign engine patching to the provider while leaving application-level recovery with you. Before comparing prices, write an owner next to each action: applying security updates, rotating credentials, changing connection limits, restoring a database, and declaring an incident resolved. Put the provider’s actual obligation next to the owner; a feature page is not an incident procedure.

The costly version of this mistake occurs when two parties each believe the other will act. Suppose an application loses access to PostgreSQL after a credential rotation. AWS RDS may report the instance as available, yet the application cannot authenticate, because database health and application access are different checks. The provider can investigate its service while your team searches GitHub Actions secrets, Kubernetes Secrets, and connection-pool configuration. The bill buys neither a shared timeline nor an agreed rollback.

I would not approve a migration on the claim that “the provider handles operations,” because that phrase cannot tell an on-call developer which console, credential, or command they need during a failed release. Ask instead for one named human owner and one executable procedure for each failure. If nobody can name who performs a restore, treat recovery as unowned even if backups appear in the console.

Comparing monthly prices hides the cost of changing your mind

A second mistake is comparing the steady-state bill for AWS RDS for PostgreSQL with the bill for PostgreSQL 16 on Amazon EC2, because those options transfer different work and create different migration paths. RDS wins when a small team needs the provider to operate the database engine and its maintenance schedule; its costs include the service premium, provider-specific configuration limits, and time spent testing what the provider’s backup controls actually restore. PostgreSQL 16 on EC2 wins when the team needs host-level control or already has people and procedures for operating it; its costs include patch scheduling, replication design, backup verification, and incident coverage.

The binary suggested by Managed Cloud vs Self-Hosted What Should Your Roadmap Fund is too coarse for a whole system, because the sensible choice for a database can differ from the sensible choice for a disposable worker. A team might put PostgreSQL on RDS while running its workers on EC2, or use a managed queue while keeping a database it knows how to restore. Evaluate each dependency by the failure you would have to resolve, not by whether its invoice comes from the same vendor.

For a planning example, assume self-hosting saves enough on the invoice to fund 12 engineer-hours per month; that is an illustrative budget input, not an observed saving. Count patch preparation, backup drills, access reviews, and interruption during incidents against those hours. If one restore rehearsal consumes most of the allowance, the apparent saving is financing work the roadmap did not name. If the team already performs those tasks reliably across several databases, the calculation may favor self-hosting; that conclusion follows from shared operational capacity, not from a cheaper virtual machine.

Also price the exit. Test whether you can export a PostgreSQL database with pg_dump—or, where a consistent physical backup is required, a tool such as pgBackRest—and restore it into an environment outside the current provider. A backup that can only be read through the service you are trying to leave is less useful during a provider dispute or account lockout, because your recovery path depends on the unavailable boundary. Record extensions, roles, and application cutover steps as well as data bytes; a successful export alone does not prove the application will start.

A backup setting is not a recovery result

The third mistake is using the presence of backups as evidence that an outage has a known duration. AWS publishes an 11-nines durability design target for S3 Standard, but that vendor-published figure does not establish how quickly your team can identify the right backup, retrieve credentials, restore PostgreSQL, and reconnect the application. Durability describes preservation of objects; recovery also requires a working sequence of decisions.

Set 30 minutes as an initial recovery-time target to tune with the product owner, rather than as a promise inferred from a snapshot setting. Then run a timed drill on an isolated environment: choose a recovery point, restore it, apply required configuration, and execute an application read and write. Record the time at which the application works, not the time at which the database reports “available,” because users cannot benefit from a database the application cannot use. Decide separately how much data loss is tolerable; recovery time and recovery point answer different questions.

A subtle failure is rehearsing the easiest restore while documenting a harder one. Restoring a snapshot into the same account with existing IAM permissions does not test what happens when the account or those permissions are unavailable. A cross-account drill costs setup time and may require security approval, but it exposes missing KMS access and undocumented DNS changes before an incident. If that scenario is outside the team’s threat model, say so explicitly; otherwise the ordinary drill can create confidence it has not earned.

Do not let a clean restore erase the cost of corrupted application state. If a faulty deployment writes bad values for several hours, the newest backup may faithfully preserve the mistake, because backups copy data without judging its meaning. Keep a way to identify the first bad write—deployment timestamps, audit events, or change-data records—and decide whether the remedy is a point-in-time restore, a targeted repair, or both. Each choice has a different cost: restoring may discard valid later writes, while a targeted repair requires trustworthy selection criteria.

Green infrastructure checks can leave the application broken

The fourth mistake is accepting a provider status or a successful Terraform apply as proof that users can complete a request. Terraform can confirm that resources match a declared configuration, and Prometheus can show that a process is reachable, but neither observation proves that the application can authenticate, query, and return a valid response. The cost is detection delay: the incident begins with users while the on-call dashboard remains green.

Start with a Blackbox Exporter probe against a representative HTTPS endpoint, and alert through Prometheus and Alertmanager when that probe fails. The following Bash check queries an existing Prometheus server for probe_success; it fails if no probes are configured, rather than reporting an empty set as healthy:

#!/usr/bin/env bash
set -euo pipefail
PROM_URL="${PROM_URL:-http://localhost:9090}"
body="$(curl --fail --silent --show-error \
  --get --data-urlencode 'query=probe_success' \
  "$PROM_URL/api/v1/query")"
printf '%s\n' "$body" | jq -e '
  .status == "success" and
  (.data.result | length > 0) and
  all(.data.result[]; .value[1] == "1")
' >/dev/null
echo "All configured probes succeeded"

This is a point-in-time check, not an outage-history query, because the Prometheus instant-query API returns the current result. Use an Alertmanager rule with a for duration for sustained failures, and tune that duration against normal probe noise rather than copying one from another service. Add an application-level check that exercises a safe database read if authentication or query failure can occur behind a healthy HTTP front door; otherwise the probe protects the load balancer more than the request path.

Make the alert identify its owner and the first diagnostic action. A page saying “database down” wastes time if the actual failure is an expired secret, because the responder may inspect CPU and storage before testing credentials. A useful runbook distinguishes provider availability, network access, authentication, and application behavior with commands the on-call developer can run using their normal permissions. Rehearse it after changing IAM policies or deployment secrets, since a procedure that requires emergency access nobody has is not a procedure.

The first useful decision is a restore appointment

Book a restore drill before choosing another service or renewing the current one. Pick one database, name the person who will restore it, and ask them to bring the contract, backup location, and application connection procedure. Time the attempt until a real application read and write succeed. The gaps you find will tell you which responsibility to buy, which to keep, and which no one owns yet.