Skip to content

Is CloudNativePG ready to replace RDS, Aurora or AlloyDB?

Last updated

View as Markdown

Quick answer: CloudNativePG runs unmodified PostgreSQL and recovered from every failure tested here: 4.3 to 7.0 seconds of client downtime on a pod delete and 77.1 seconds on a node kill, measured on 2026-09-21. The harder question is whether to take on the jobs the vendor was doing: backups, which are off until you turn them on; replication durability, which is asynchronous until you change it; node detection, which is a Kubernetes default you now own; and major version upgrades, which are not a rolling image change.

CloudNativePG is a Kubernetes operator: a controller that creates PostgreSQL pods, decides which one is the primary, and reacts when that changes. It runs community PostgreSQL, not a fork.

So “is it ready” is less about PostgreSQL than about which jobs a managed service was doing for you that you have not noticed yet.

What was tested, and what was not. Every number below came from a three-instance CloudNativePG 1.30.0 cluster running PostgreSQL 18.1 on Kubernetes 1.35.5, with one instance per node, measured on 2026-09-21. Tested: primary pod deletion, node stop, asynchronous and synchronous replication, client reconnection on a direct connection to the primary service, and PVC capacity on the local-path provisioner. Not tested: recovery time through a pooler, network partition, zone loss, control-plane outage, storage detach failure, restore from object storage, or a major version upgrade. Each is named where it matters, with what the documentation says. Run those before relying on any readiness verdict, including this one.

The version numbers record what was tested; they do not claim to be current. CloudNativePG 1.30 ships a newer PostgreSQL default image than 18.1 now, and the image contents are a deploy-time choice anyway.

Failover on pod loss is fast, in this test. Measured on 2026-09-21 on CloudNativePG 1.30.0 with PostgreSQL 18.1 in ghcr.io/cloudnative-pg/postgresql:18.1 pods on Kubernetes 1.35.5. This is the client, writing every 200 ms through the cluster’s -rw service. target_session_attrs is what makes a connection to a demoted primary fail rather than succeed and write somewhere useless:

Terminal window
URL="postgresql://app@app-db-rw:5432/app?connect_timeout=2&target_session_attrs=read-write"
while true; do
if psql "$URL" -Atq -c 'INSERT INTO beat DEFAULT VALUES;' >/dev/null 2>&1
then echo "$(date -u +%H:%M:%S.%3N) ok"
else echo "$(date -u +%H:%M:%S.%3N) FAIL"
fi
sleep 0.2
done

With that running, kubectl delete pod $PRIMARY. Measured on 2026-09-21 on CloudNativePG 1.30.0, PostgreSQL 18.1 from ghcr.io/cloudnative-pg/postgresql:18.1, Kubernetes 1.35.5, four failovers on the same cluster. The client output around one of them:

00:47:26.099 ok
00:47:26.376 FAIL
...
00:47:30.761 FAIL
00:47:31.115 ok

Ten failed attempts, a 5.016 second gap. Across four failovers on 2026-09-21 on that CloudNativePG 1.30.0 cluster, PostgreSQL 18.1 in ghcr.io/cloudnative-pg/postgresql:18.1, the gaps were 4.280, 5.016, 6.477 and 6.978 seconds. The operator’s own decision is earlier than any of them: it logged Current primary isn't healthy, initiating a failover 1.387 seconds after the delete was issued in that run, then Failing over from app-db-1 to app-db-2. The rest is the new primary being promoted and the client’s next retry landing.

Four observations on one CloudNativePG 1.30.0 cluster on 2026-09-21 are still four observations on one cluster, not a service level objective. .spec.failoverDelay defaults to 0 seconds, and was 0 here, so the operator does not wait before deciding. Storage attach, scheduling, readiness and your client’s own retry behaviour are all part of the total, and none of them were varied here.

Recovery of the old primary is automatic. When the old primary came back it ran pg_rewind against the new one without being asked and rejoined as a replica, with no human step. Measured on 2026-09-21 on CloudNativePG 1.30.0 and PostgreSQL 18.1, the instance manager in the demoted pod logged Extracting pg_controldata information with "reason":"before pg_rewind", then Starting up pg_rewind, then pg_rewind: connected to server, all within 200 milliseconds and with nothing issued by hand.

The extension set is normal. Measured on 2026-09-21 in a ghcr.io/cloudnative-pg/postgresql:18.1 container running PostgreSQL 18.1, 48 extensions were available in the image this test ran, including vector, pgaudit and pg_stat_statements. That is a property of the image, not of CloudNativePG: extension composition is a deploy-time choice. CloudNativePG 1.30 also documents a separate mechanism, image volume extensions, which mount “a PostgreSQL extension, packaged as an OCI-compliant container image, as a read-only and immutable volume at a designated filesystem path within a running pod”, and which that page says needs PostgreSQL 18 or later and Kubernetes 1.35 or later. This page did not test it. An available control file also is not the same as an extension you are allowed to run.

What is specific to CloudNativePG is that these are upstream PostgreSQL instances using standard physical streaming replication. Aurora and AlloyDB are PostgreSQL-compatible, so SQL, planner, schema and extension knowledge carries over to them too. Their storage, replication, recovery and failure behaviour do not carry over, because those are provider-managed and different.

Connection pooling is a first-class object. The test deployed a two-replica Pooler running PgBouncer 1.25.1 in transaction mode in front of the primary service. Replica count and pool mode are both configuration, not defaults you inherit, and transaction mode has application consequences: session settings, some prepared-statement handling, temporary tables, advisory locks and LISTEN/NOTIFY do not survive it. Every recovery figure on this page is a direct connection to the primary service. What a pooler does to those numbers is a separate measurement and it is on CloudNativePG pooler or direct connections, not here.

Version currency was not a problem here. PostgreSQL 18.1 was running on day one of the test. That is a dated test observation; it says nothing about who ships what first.

A Backup resource against a cluster with no backup section is rejected:

failed: cannot proceed with the backup as the cluster has no backup section

That is correct behaviour, and the precise claim is narrower than “backups are off”: a new cluster has no configured, scheduled remote backup and no WAL archiving, so it has no point-in-time recovery. The cluster comes up healthy, serves traffic, and has nothing to restore from.

The managed side is not uniform either, so check yours rather than assuming:

servicewhat the documentation says, checked 2026-09-19
AuroraAurora backups: “the default backup retention period is one day regardless of how the DB cluster is created. You can’t disable automated backups on Aurora.”
RDSRDS automated backups: “You enable automated backups by setting the backup retention period to a positive nonzero value.” RDS CreateDBInstance gives BackupRetentionPeriod a default of 1 and says “Setting this parameter to 0 disables automated backups.”
AlloyDBAlloyDB backup overview: continuous backup and recovery “is enabled by default, with a configurable retention window of 1 to 35 days”

Aurora’s backups cannot be disabled, while RDS backups depend on the retention setting, which can be zero. “Managed means backed up” is true of one of them as stated.

Configuring backups is a design, not a checkbox

Section titled “Configuring backups is a design, not a checkbox”

Choose the mechanism deliberately. The CloudNativePG 1.30 backup documentation describes two with different properties, and the one most blog posts show is on the way out: backups go “Via CNPG-I plugins: the CloudNativePG Community officially supports the Barman Cloud Plugin for integration with object storage services” or “Natively, with support for: Object storage via Barman Cloud (although deprecated from 1.26 in favor of the Barman Cloud Plugin), Kubernetes Volume Snapshots, if supported by the underlying storage class”.

The same CloudNativePG 1.30 backup documentation is direct about the trade. Object store backups “Always require WAL archiving”, “Support hot backups only” and “Support retention policies”. Volume snapshots “Do not require WAL archiving, though its use is still strongly recommended in production”, “Support incremental and differential copies, depending on the capabilities of the underlying storage class” and “Do not support retention policies”.

The remaining decisions include base backup cadence, WAL archive latency, an alert for an archive falling behind, retention window arithmetic against the recovery objective, object-store versioning and immutability, encryption and key ownership, separate credentials from the cluster’s own, and a scheduled restore rehearsal. A volume snapshot on the same storage as the cluster is not a backup against losing that storage. Match the mechanism to the failure domain you need to cover.

The node is stopped outright rather than drained, because a drain does not simulate this failure:

Terminal window
docker stop -t 0 "$NODE_HOLDING_THE_PRIMARY"

Measured on 2026-09-21 on a three-node cluster, Kubernetes 1.35.5, CloudNativePG 1.30.0, PostgreSQL 18.1, with the same 200 ms writer as above:

what happenedafter the node stopped
node Ready becomes Unknown51.7 s
primary pod Ready becomes False51.9 s
cluster phase becomes Failing over53.9 s
status.currentPrimary moves71.2 s
the client writes again77.0 s

Every figure in that column is measured on 2026-09-21 from the moment the node was stopped, on CloudNativePG 1.30.0 with PostgreSQL 18.1 in ghcr.io/cloudnative-pg/postgresql:18.1 on Kubernetes 1.35.5. The client’s own view of that same 2026-09-21 run against those ghcr.io/cloudnative-pg/postgresql:18.1 PostgreSQL 18.1 instances is slightly different: the gap between its last successful write and its next one was 77.1 seconds, because its last success landed 0.1 seconds before the node went down. It failed 53 consecutive attempts and then succeeded, with no further failure after that, so recovery and the end of failing are the same instant here.

Against a pod delete on that same CloudNativePG 1.30.0 and PostgreSQL 18.1 cluster on 2026-09-21, the client recovered in 4.3 to 7.0 seconds across four failovers. In the one of those four whose operator log was timed, failover began 1.4 seconds after the delete. A node failure cost the client 77.1 seconds against 4.3 to 7.0, which is eleven to eighteen times as long, and nothing about the database changed between them.

The eviction toleration is not in that timeline at all. The CloudNativePG 1.30 failover documentation says so: “Pod eviction (actual deletion from the unreachable node) is a separate mechanism, driven by tolerationSeconds on the node.kubernetes.io/unreachable NoExecute taint (300s by default). That timer does not hold up the operator’s failover decision; CloudNativePG promotes a new primary as soon as the Ready condition flips.”

That holds for the database’s pod. It does not hold for the operator’s pod, and on a small cluster that difference determines how long the outage lasts.

Do not let the operator share a node with the primary. CloudNativePG ships one replica of cnpg-controller-manager by default, and failover is work the operator does. If the node that fails is also the node running the only operator pod, nothing decides anything until Kubernetes evicts that operator pod, and the operator’s pod carries the same stock 300 second tolerationSeconds as any other.

Measured on 2026-09-21 on the same CloudNativePG 1.30.0 cluster running PostgreSQL 18.1 in ghcr.io/cloudnative-pg/postgresql:18.1 on Kubernetes 1.35.5, with the only difference being which node the operator was on:

operator elsewhereoperator on the failing node
primary pod Ready becomes False51.9 s51.6 s
failover begins53.9 s373.9 s
status.currentPrimary moves71.2 s391.5 s
the client’s gap between successful writes77.1 s390.9 s

The first three rows are measured from the moment the node stopped. The last row is not: on 2026-09-21 on CloudNativePG 1.30.0 with PostgreSQL 18.1 in ghcr.io/cloudnative-pg/postgresql:18.1, it is the client’s own gap between its last successful write and its next one, which is why it reads 77.1 s here and 77.0 s in the table above, where that row is measured from the stop like its neighbours.

The events from the second column’s run show the cause:

00:54:35 NodeNotReady Node is not ready
00:59:35 TaintManagerEviction Marking for deletion Pod cnpg-system/cnpg-controller-manager-...
00:59:56 LeaderElection cnpg-controller-manager-...-7kfrt became leader
00:59:58 FailingOver Current primary isn't healthy, initiating a failover

Five minutes passed between the taint and the eviction, followed by leader election and the failover decision two seconds later. The delay came from the operator not running, not from the operator being slow.

Read precisely, the documentation’s sentence is accurate: the eviction timer does not hold up the operator’s decision. It does hold up the operator’s existence, and failover cannot begin until a replacement operator pod is running. Give the operator deployment more than one replica, or anti-affinity against the database pods, or both. On a three-node cluster this is easy to get wrong and expensive to discover during an incident.

The 52 seconds is the part worth tuning, and it is the Kubernetes control plane rather than the operator. The same CloudNativePG 1.30 failover documentation: “With stock kube-controller-manager settings, the transition is governed by --node-monitor-grace-period (default 40s on Kubernetes 1.29-1.31, raised to 50s in 1.32 and later).”

Lowering it shortens every node failure in the cluster and makes every brief API server hiccup look like one. That is a cluster-wide trade with partition behaviour on the other side, not a dial for one database. Managed services made this trade for you; they publish their architecture but not, usually, a per-incident timer.

The rest of the total also counts. Promotion, volume attach, readiness, service endpoint convergence and your client’s reconnection all sit between “failover began” and “writes succeed”, which is why the table above reports five timestamps rather than one. “Time until failover began” is not RTO.

The failure this page has not tested is the one worth understanding before lowering any timer: a node that Kubernetes cannot reach but that is still running and still reachable by some clients. Promote a replica in that state and there are two primaries.

CloudNativePG 1.30 ships two mechanisms for this and the CloudNativePG 1.30 failover documentation says both are on by default. The primary lease stops a replica promoting too early: “a replica cannot promote while the former primary still holds the lease”, with .spec.primaryLease defaulting to a 15 second duration and a 10 second renewal deadline. The primary isolation check handles the other half, and the documentation is explicit that the lease alone does not: “The lease does not fence a primary that has lost connectivity to the Kubernetes API server but is still running; that is the job of the primary isolation check.”

The same CloudNativePG 1.30 failover documentation also warns: “Keep both enabled. Disabling the isolation check leaves the lease alone responsible for primary safety, and the lease alone cannot prevent split-brain when the former primary cannot reach the API server but remains otherwise healthy.”

Older advice on this, including bug reports saying CloudNativePG does not fence an isolated primary, predates these defaults. Check what your version does rather than what a 2025 thread says, and test it, because this page has not.

Replication is asynchronous until you say otherwise

Section titled “Replication is asynchronous until you say otherwise”

In this cluster’s configuration, a three-instance cluster reported both standbys as async with synchronous_standby_names empty, while synchronous_commit read on. Those two together mean the primary acknowledges the commit once its own WAL is flushed to local storage. The standbys still stream and flush that WAL; no standby’s acknowledgement is on the commit path. So the exposure is the replay lag at the moment the primary dies, which is a number you can watch and not a number you can promise.

Measured, that window did not open. On 2026-09-21 on CloudNativePG 1.30.0 with PostgreSQL 18.1 in ghcr.io/cloudnative-pg/postgresql:18.1 containers, the 200 ms writer above was changed to INSERT INTO beat DEFAULT VALUES RETURNING id, so that every line it logs is an id the primary acknowledged, and then the node was stopped and the new primary asked whether that id was there. It was there after both node stops, and the highest surviving id at or below it was itself. No acknowledged write was lost.

A null result means little unless the instrument could have seen the event. On that same 2026-09-21 CloudNativePG 1.30.0 cluster running PostgreSQL 18.1 in ghcr.io/cloudnative-pg/postgresql:18.1 containers, pg_stat_replication on the primary reported 0 bytes of unwritten WAL to both standbys, and 0 bytes means no window to land in. That reading is wrong in the way single samples usually are: polled in a tight loop, 800 samples during the same bulk load put the peak at 1,130,496 bytes, and 5,128,776 bytes before the second node stop. So there was a multi-megabyte window of WAL the standbys had not written, the test was pointed at it, and the acknowledged write still survived, because what the standbys are behind on is the bulk load rather than the heartbeat commit, which had already shipped.

That is one fixture on local disks. It says the exposure is real and small here, not that it is small on your storage.

Turning it on is one patch:

kubectl patch cluster app-db --type merge \
-p '{"spec":{"postgresql":{"synchronous":{"method":"any","number":1}}}}'

After which synchronous_standby_names reads ANY 1 ("app-db-1","app-db-3","app-db-2") and the standbys report sync_state = quorum.

That patch is a minimal example, not the durability design. The design is method, number, dataDurability, where the synchronous replicas sit relative to the primary’s failure domain, the latency you are adding to every commit, and what happens when a required standby is gone. CloudNativePG also has .spec.postgresql.synchronous.failoverQuorum, which the CloudNativePG 1.30 failover documentation describes as promoting only when the operator can “confirm the presence of all synchronously committed data in the instance to promote”, and not otherwise. That is a durability-over-availability choice, and it is a separate field.

The comparison is narrower than it first looks. Aurora and AlloyDB do not expose PostgreSQL’s synchronous_standby_names as their durability control, because their managed storage provides a different one. The Aurora high availability documentation says: “When data is written to the primary DB instance, Aurora synchronously replicates the data across Availability Zones to six storage nodes associated with your cluster volume.”

“RDS Multi-AZ” is two architectures, not one, and the RDS Multi-AZ documentation separates them: “A Multi-AZ DB instance deployment has one standby DB instance that provides failover support, but doesn’t serve read traffic”, while “A Multi-AZ DB cluster deployment has standby DB instances that provide failover support and can also serve read traffic.” An RDS read replica is asynchronous and is neither of those. Name the deployment model before comparing replication semantics.

Storage behaves like your storage class, not like a cloud disk

Section titled “Storage behaves like your storage class, not like a cloud disk”

Measured on 2026-09-21 on Kubernetes 1.35.5 with CloudNativePG 1.30.0 and PostgreSQL 18.1 in ghcr.io/cloudnative-pg/postgresql:18.1, on the local-path provisioner, a directory declared as a 1Gi PVC grew past 1.4 GB. That provisioner does not enforce the request.

Be careful what that generalises to, because local-path is a development provisioner and this result is specific to it. A storage class on Kubernetes may provision cloud block storage, in which case you get that disk’s behaviour through its CSI driver. The durable point is that a PVC request is not universally an enforced quota: whether it is depends on the driver, on block versus filesystem mode, and on whether any filesystem quota is actually applied. What you inherit from the storage class is capacity enforcement, throughput and IOPS, fsync semantics, zone affinity, attach and detach behaviour, resize policy, and snapshot support. Fill a test volume and watch what happens, rather than reading the class name.

Two more things a three-pod cluster does not give you on its own. The pods must be spread across nodes and ideally zones, with anti-affinity or topology spread rules, or a single node failure takes more than one instance. And CloudNativePG creates PodDisruptionBudgets per cluster precisely because Kubernetes maintenance is a database event: leave them on, and know that they will block a node drain.

Minor version upgrades are a rolling image change and CloudNativePG handles them. Major versions are not. The CloudNativePG 1.30 upgrade documentation lists three methods and none of them is a rolling update. In its words, logical dump/restore is “Blue/green deployment, offline”, native logical replication is “Blue/green deployment, online”, and physical with pg_upgrade is “In-place upgrade, offline”.

Each is a project with a rehearsal and a rollback path. So is upgrading the operator itself, which rolls the instance managers and, under the default primaryUpdateStrategy: unsupervised, ends in an automated switchover. That automation is useful, but it is a change you have to schedule rather than discover.

Monitoring moves to you as well. A managed console was giving you replication lag, WAL generation rate, archive success and archive age, backup age, last successful restore test, PVC capacity and inodes, checkpoint behaviour, pooler saturation, pod and node placement, PodDisruptionBudget (PDB) disruptions, and operator events. None of that arrives with the operator.

Against RDS. RDS is the closest match. What moves to you is not three features. RDS owns host replacement, storage management, the HA mechanics, backup and PITR plumbing, maintenance workflows and monitoring integration, and it sells you a support contract that covers all of it. You still own parameters, network and security configuration, schema and query behaviour, client retry logic, and proving your restores work. Take the RDS column and move the first list across; that, plus the second list which you already had, is the job. You get plain PostgreSQL with no service charge per instance, and a failover you can measure yourself rather than one you read about.

The cost comparison is not instance price against instance price. It is worker nodes, the Kubernetes control plane, storage and its IOPS, object storage and its egress, inter-zone traffic, observability, and the engineering time above, against a bill. Do the arithmetic with the whole list.

Against Aurora. Aurora is a different product. Its distributed storage reduces replica storage duplication and affects its recovery behaviour, though read scaling still needs reader instances you pay for and an application that routes to them. You cannot reproduce the storage layer with an operator, and a comparison that only counts cost per instance is comparing the wrong thing.

Against AlloyDB. The same caveat applies, along with the columnar engine. If the workload is analytics on PostgreSQL data, that is the feature being bought.

Against all three, on versions. Checked on 2026-09-18: PostgreSQL 18 became generally available on Cloud SQL on 2025-11-20, on RDS on 2025-11-14, on AlloyDB on 2026-03-25 and on Aurora on 2026-06-11. “Managed services are years behind” is out of date as an argument.

Ask who is on call, not what the operator can do.

Choose CloudNativePG when you already run Kubernetes competently, you want plain PostgreSQL with no vendor extensions in the way, you have somewhere off this cluster to put backups, you have tested a restore and a partition rather than a pod delete, you have an upgrade runbook for a major version, and someone owns the whole stack at three in the morning: PostgreSQL, the operator, the CSI driver, the CNI and the cloud underneath them.

It is not a drop-in replacement because pod failover is fast. Fast pod failover is the easiest of the things on that list.

Stay managed when the database is the only stateful thing you run, when the backup and restore story has to be somebody else’s, or when you are buying Aurora or AlloyDB for their storage layer rather than for PostgreSQL.

Whichever you choose, test the failure modes rather than trusting the architecture diagram. Every number in this article came from killing something, and the sections with no numbers in them are the ones this test did not cover, which is why they say so.

  • Is CloudNativePG production ready?

    The bounded answer the tests support: measured on 2026-09-21 on CloudNativePG 1.30.0 and PostgreSQL 18.1, it operated a three-instance PostgreSQL cluster, put a writing client back in service in 4.3 to 7.0 seconds over four failovers, began failover 1.4 seconds after the delete in the one of those four where the operator log was timed, and rewound and rejoined the old primary with no human step. That is not a general readiness verdict. A replacement decision also needs node loss, zone loss, storage loss, partition behaviour, a rehearsed restore, and an upgrade path, and this page says which of those were tested.

  • Do I get new PostgreSQL versions sooner on Kubernetes?

    Not meaningfully any more. PostgreSQL 18 was generally available on Cloud SQL on 2025-11-20, on RDS on 2025-11-14, on AlloyDB on 2026-03-25 and on Aurora on 2026-06-11, checked on 2026-09-18. Version lag is a weaker argument for self-hosting than it used to be.

  • What is the biggest operational difference?

    Failure detection. Deleting a pod fails over in seconds because Kubernetes tells the operator immediately. Losing a node is slower, and the delay is node detection rather than pod eviction: measured on 2026-09-21 on Kubernetes 1.35.5 with CloudNativePG 1.30.0 and PostgreSQL 18.1, the primary pod was marked not ready at 51.9 seconds, failover began at 53.9 seconds, and a client writing every 200 ms went 77.1 seconds between its last successful write and its next one. That first 51.9 seconds is a kube-controller-manager default, not CloudNativePG behaviour. One exception swamps all of it: if the failing node is also running the only cnpg-controller-manager pod, nothing happens until that pod is evicted on its own 300 second toleration, and the same failure took 390.9 seconds.

  • Are backups included?

    No scheduled remote backup or point-in-time recovery policy exists until you configure one. A Backup resource against a cluster with no backup section is rejected with cannot proceed with the backup as the cluster has no backup section. Managed services differ from each other here: Aurora says the default retention is one day and that automated backups cannot be disabled, while RDS says backups are enabled by setting a nonzero retention period and 0 disables them.

  • Is replication synchronous by default?

    No. A three-instance cluster replicates asynchronously unless you configure otherwise, and synchronous_commit = on does not change that on its own. That is a lost-write window on paper, and two node stops on 2026-09-21 on CloudNativePG 1.30.0 with PostgreSQL 18.1 did not open it: the last write the client had been acknowledged survived both promotions, including the one taken while streaming write lag on the primary peaked at 5,128,776 bytes. The window is real and this fixture did not land in it.