Your PostgreSQL Failover Worked. Can Your App Write Again?

Your PostgreSQL Failover Worked. Can Your App Write Again?

BackerLeader ●63 ●389 ●570
calendar_today ago • schedule6 min read

PostgreSQL keeps showing up in places that used to belong to Oracle and SQL Server. Some of that comes from big migration projects. But a lot of it is quieter. When a team builds the next app, PostgreSQL is now the database it reaches for.

That shift puts business-critical work on PostgreSQL. And it raises a harder question than "will the database fail over?" The real question is whether the business keeps running when it does.

Don Boxley, CEO and co-founder of DH2i, has spent more than 15 years building high availability for SQL Server. I asked him what changes when PostgreSQL starts carrying the workloads that can't go down. His answers kept landing on the same point. A database that recovers on time doesn't help much if the app is still throwing errors.

New apps, not just migrations

Boxley sees PostgreSQL winning the next workload more often than the existing one.

"For instance, if you're replacing the stock inventory system, you can put that on PostgreSQL without ever touching the rest of the existing ERP," he said. "I think three years ago, more folks would have put it on whatever database they already had running."

The draw is a mature ecosystem of tools for AI workloads and no per-core license fees. Boxley framed the cost case in practical terms: "if the new system takes off and needs twice the compute, that's one less bill that doubles."

For teams that do migrate, he said the thing they underestimate most is people. Picture month-end close, and finance says its reports are running twice as long.

"Your SQL Server manager you've had for 10 years likely knows exactly which job to check first. You can move your data to PostgreSQL. But, that doesn't replace 10 years of experience which tells you where to look."

His advice is to give that person time with the new system under real load before handing over the pager. Find out what trouble looks like. Time a restore using your own data, not a sample database.

Embeddings change the blast radius

Running operational data and vector embeddings in one database is a real win for developers. Boxley used a repair technician as the example. You can search for similar past jobs and filter to the equipment that customer owns, without standing up a second database.

But the operations team sees it differently. "If a vector index rebuild slows down their system, the dispatch team probably doesn't care how elegant that is," he said. "I would want to know whether we can put search on pause without putting dispatch on pause with it."

Every failover tool has a weak spot

Streaming replication gives you a standby. It doesn't tell you whether the primary is dead or whether you just lost the connection to it. That matters a lot if the old primary is still taking writes.

Boxley didn't rank the tools. He asked a different question of each one:

  • Patroni: What happens when the primary can't reach the configuration store?
  • repmgr: If you use a witness, can it see enough to decide well when sites stop talking?
  • pg_auto_failover: If the monitor is gone and then the primary goes too, what happens?
  • Pacemaker: Can it actually fence the old primary on your infrastructure? "Don't take that one on faith."
  • Kubernetes operators: Does the operator still work when part of Kubernetes is struggling? Are replicas spread far enough apart?
  • Managed services: The provider moves the database. Who makes sure the app drops old connections and opens new ones?

That last question points to where he'd start troubleshooting. Boxley said he didn't have the data to rank outage causes. But he offered a practical rule: "if you tell me the standby was promoted and nobody can get into the app, I'd look at the connection pool before I started taking the database apart."

The other two failure modes are worse because they touch the data itself. With an asynchronous standby, replication lag can mean transactions you already confirmed are gone after failover. With split-brain, two servers both accepted writes. "Getting back online doesn't tell you which version of the data is right," he said.

Set targets the business can feel

For a single primary going down, Boxley would start by testing whether the app can write again within a couple of minutes. AWS documents typical RDS Multi-AZ failover times of 60 to 120 seconds, which gives a useful reference. But he added a caveat: "nobody using it cares that the database finished on time if your app is still throwing errors at 121 seconds."

Zero lost, acknowledged transactions is a fair goal for the failure you've built synchronous replication to cover. If a whole region disappears and you recover from an asynchronous copy, he wouldn't promise zero.

He also wouldn't put an industry number on outage cost. "Ten minutes offline at 4 a.m. and ten minutes offline during payroll can be very different problems, even inside one company."

The same thinking applies to measuring recovery. Did dispatchers have to re-enter jobs? Did a technician get sent out twice? How long until someone could assign the next job? "That's going to tell you more than a stopwatch on the database alone," he said.

Kubernetes, edge, and managed services

Is PostgreSQL on Kubernetes ready for critical work? "Absolutely, but with some key considerations," Boxley said. Copies need to live in separate zones on separate volumes. Storage has to keep up at peak load. The app needs a stable endpoint that always points to the current primary. And the team should be able to get through an ordinary node drain, and restore into a different cluster, before anyone calls it ready.

Distributed deployments add a different problem. "Postgres can be running just fine, while a branch office cannot reach it," he said. Decide ahead of time what that office needs to do. Is a local copy for inventory lookups enough, or does the app need to queue orders until the link returns? Distance matters even when the network is up. Users feel it if every write waits on a standby across the country.

Managed services like Amazon RDS, Azure Database for PostgreSQL, and Google Cloud SQL are often the right answer. "I wouldn't build my own failover system just to say I did it," Boxley said. But ask your provider which failures you're covered for. A zone is not a region. If you've promised the business recovery in your own data center or another cloud, someone on your team has to own that plan.

That's the gap DH2i wants to fill. The company plans to bring PostgreSQL support to its DxEnterprise software starting in early 2027, with automated failover and built-in zero trust tunneling between sites and clouds.

Three tests for this quarter

Boxley's homework for PostgreSQL teams is short and uncomfortable:

  1. Fail the primary during a write. Check when the app can write again, and whether the old primary still accepts writes.
  2. Check replication lag when you're busy. If you had to promote the standby right then, how much data would be missing? The person making that call should know.
  3. Hand someone the backup and the instructions. Ask them to restore to 10:14 yesterday morning. Pick someone who didn't write the instructions. "Try not to help."

The twentieth database

Looking two years out, Boxley said the teams that win will make their twentieth database easier to run than their first. They'll have a few proven setups and know which one fits payroll and which one fits a Friday report.

"And when the person who sets it all up goes on vacation and something happens, somebody else will be able to get it back online. That last part is critical."

I think he's right, and it applies well beyond PostgreSQL. High availability isn't a feature you buy or a tool you install. It's a set of tested habits, owned by more than one person. The database is only the first thing that has to come back.

Want more #devops & #kubernetes deep dives?

Join 6,119+ developers sharing real benchmarks, code breakdowns, and projects. Free forever.

More Posts

Your AI Agent Doesn't Need Your Token: Edera's Ariadne Conill on Object Capabilities

Tom Smithverified - Nov 5

Your Kubernetes Requests Are a Guess. groundcover Wants an Agent to Keep Fixing Them.

Tom Smithverified - Nov 3

Your AI Doesn't Just Write Tests. It Runs Them Too.

Kevin Martinez - May 12

StarlingX 13.0 Turns Two Edge Upgrades Into One Reboot. Test the Targets Yourself.

Tom Smithverified - Nov 24

Kamal vs Kubernetes: An Honest Comparison for Teams Who Don’t Need 1,000 Services

Alexandre Vazquez - Jul 24
chevron_left
21.6k Points • 1k Badges
299Posts
177Comments
153Connections
LLM Training & Evaluation Specialist with hands-on experience building major AI models. As one of th... Show more

Commenters (This Week)

1 comment
1 comment
1 comment

Contribute meaningful comments to climb the leaderboard and earn badges!