Quick revision
The short answer
We compare the total cost, including the staff time spent on patching, upgrades, backups and on-call, not only instance prices. Then the feature gaps (extensions, available versions, superuser needs, logical replication, parameter limits), performance and storage measured with our own workload, failover times and maintenance windows against our SLOs, and the migration path and lock-in, including the effort to move away later.
What to remember
In this answer, we compared self-hosted PostgreSQL with Patroni against a managed service on total cost including staff time, feature gaps such as extensions, versions, superuser needs, logical replication and parameter limits, performance and storage measured with our own workload, failover times and maintenance windows against our SLOs, and the migration path and lock-in, including how we would leave later.
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 compare the total cost, including the staff time spent on patching, upgrades, backups and on-call, not only instance prices. Then the feature gaps (extensions, available versions, superuser needs, logical replication, parameter limits), performance and storage measured with our own workload, failover times and maintenance windows against our SLOs, and the migration path and lock-in, including the effort to move away later.
Why this question is asked
A team running PostgreSQL on VMs with Patroni has usually invested a lot to get there: Patroni manages leader election and failover through a store such as etcd, and the team has tuned backups, monitoring and upgrades over years. A suggestion to move to a managed service can sound either like relief or like a threat. Interviewers ask this to see whether we can compare the two honestly with evidence, rather than defending the current system or chasing a trend. In this answer, we will compare total cost, feature gaps, performance with our workload, availability against our SLOs, and the migration path and lock-in, and then see how to make the decision.
1Total Cost, Not Instance Price
The first comparison people make is the hourly price of a VM against the hourly price of a managed instance of the same size. The managed instance usually costs more, often by a significant fraction, and the discussion ends there. But the VM price leaves out most of the cost. Self-hosting means people patch operating systems and PostgreSQL, plan major upgrades, run and test pgBackRest or Barman, look after Patroni and etcd, handle disk failures and are on call at night when a failover misbehaves.
So we add up staff time. If two engineers spend about 40 percent of their time on these tasks, at a fully loaded cost of 150,000 a year each, that is 120,000 a year. We also count the extra standby and backup infrastructure we run ourselves. For a fleet of 10 clusters, the managed premium may be smaller than that staff time, or larger; the point is to compare the real totals, and to be honest about which tasks really disappear. Query tuning, schema work and capacity planning stay with us either way.
| Cost item | Self-hosted with Patroni | Managed service |
|---|---|---|
| Compute and storage | 180,000 | 260,000 |
| Backup storage and tooling | 25,000 | included, plus extra retention |
| Patching, upgrades, backup ops (staff) | 120,000 | 30,000 |
| On-call for infrastructure failures | 40,000 | 10,000 |
| Query and schema work (staff) | same | same |
| Total of the differing items | 365,000 | 300,000 |
2Feature Gaps
Next we list what we use today and check each item on the managed service. Extensions come first: PostGIS, pg_partman, TimescaleDB, pg_cron, pgvector and others are each supported or not, sometimes at an older version, and anything outside the provider's list cannot be installed. PostgreSQL versions matter too: a new major version usually reaches managed services months after its release, and old versions are retired on the provider's schedule, not ours.
Then superuser needs. Without a real superuser and host access, some things change: custom background workers, reading server files, some monitoring agents, and tools that rely on physical replication from outside. Logical replication is usually available but with provider-specific settings. Some parameters are fixed or restricted, which matters if we have tuned things like shared_buffers ratios, WAL settings or custom logging carefully. Each gap goes into a table with a decision: not needed, has an alternative, or a blocker.
3Performance and Storage With Our Workload
Benchmarks from the provider do not tell us how our workload behaves. Storage is where the differences hide. A VM with local NVMe can have very low latency; network-attached volumes on a managed service add some, and are limited by provisioned IOPS and throughput. Aurora uses a different storage layer that replicates across zones and changes the cost and performance of writes, and its standard configuration bills for I/O requests, which can make inefficient queries expensive.
So we test. We restore a copy of production into the candidate service, replay a realistic workload with something like pgbench custom scripts or recorded production queries, and compare p95 and p99 latency of our top queries, throughput at peak, and storage cost at our actual I/O rate. A few days of testing usually answers questions that weeks of reading cannot.
4Failover and Maintenance Against Our SLOs
Patroni can often fail over in tens of seconds, and the team knows exactly how it behaves. A managed service's failover time depends on the product; for some it is under a minute, for others longer, and the application must reconnect. We measure it by forcing failovers on the test instance while the application runs, and look at how long requests fail.
Maintenance windows matter too. The provider will apply patches and sometimes require restarts within our chosen window, and some mandatory updates cannot be postponed forever. If our SLO is 99.95 percent a month, which allows about 22 minutes of downtime, a few unplanned minutes for maintenance and a slow failover could use much of that budget. We write down the measured numbers next to the SLO and see whether they fit.
5Migration Path and Lock-In
Getting in is usually manageable. For smaller databases, dump and restore in a maintenance window works. For larger ones with short downtime, logical replication from the Patroni cluster into the managed instance keeps it in sync until cutover; some providers also offer migration services. We check that our tables have primary keys or replica identity for logical replication and plan how to handle sequences and DDL during the sync.
Getting out matters as much. Standard managed PostgreSQL is still PostgreSQL, so leaving later means another logical replication migration, which is work but not a rewrite. Proprietary features, such as Aurora-specific behaviour, provider IAM authentication or other provider-only tools, make leaving harder the more we use them. We decide in advance which of those we accept and record it.
- Total cost lower or equal?including staff timeYesContinue evaluationNoNeed a strong non-cost reason
- Any feature blockers?extensions, versions, superuserYesStay or redesign that partNoContinue
- Workload test meets latency and cost?replay real queriesYesContinueNoTry another tier or stay
- Failover and maintenance fit SLOs?measured, not quotedYesPlan migration with exit pathNoStay self-hosted
4 steps in order. Play them, or step through them one at a time.
6Follow-up questions
Can we keep some clusters self-hosted?
Yes, and that is often the outcome. Clusters with unusual extensions, very high I/O needs or special tuning may stay on Patroni, while ordinary OLTP databases move. The cost is running two operating models, so the self-hosted set should be small and deliberate.
What happens to the team's Patroni knowledge?
It is not wasted. Understanding replication, failover and backup deeply makes the team better at evaluating and operating managed services, at handling failovers in the application and at running the clusters that remain self-hosted.
How long should the evaluation take?
A few weeks is typical: one to two for the cost model and feature list, one to two for workload and failover tests on a copy of production. That is small compared with the years the decision will last.
7Conclusion
In this answer, we compared self-hosted PostgreSQL with Patroni against a managed service on total cost including staff time, feature gaps such as extensions, versions, superuser needs, logical replication and parameter limits, performance and storage measured with our own workload, failover times and maintenance windows against our SLOs, and the migration path and lock-in, including how we would leave later.
Open with
I would compare them on evidence in five areas. First, total cost: not just instance prices, which usually favour self-hosting, but the staff time we spend on patching, major upgrades, backups, Patroni and etcd, and night-time on-call, and which of those tasks really disappear, because query tuning and schema work stay with us either way.
Then, if they want more
Second, feature gaps: I would list every extension we use and check support and versions, check PostgreSQL version availability and retirement schedules, what breaks without a real superuser or host access, logical replication options, and any parameters we tune that the provider restricts.
Third, performance: I would restore a copy of production into the candidate service and replay our real workload, comparing p99 latency of the top queries and the storage cost at our I/O rate, especially for something like Aurora where I/O can be billed.
Fourth, availability: I would force failovers during the test and measure the application impact, and compare that plus maintenance windows with our SLO budget. Fifth, migration and lock-in: logical replication to get in, and how hard it would be to get out if we use proprietary features. Then decide per cluster.
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 "Your team runs self-hosted PostgreSQL on VMs with Patroni. Management suggests moving to...": https://scrivio-interview-library.netlify.app/databases/database-operations/56aea4bc16/