Amazon RDS for PostgreSQL vs self-hosted PostgreSQL

Amazon RDS for PostgreSQL trades control for managed operations, while self-hosted PostgreSQL gives full superuser, extension and hosting control at the cost of running high availability, backups and upgrades yourself. Choose by the control, compliance and staffing you need.

On this page

Which PostgreSQL option fits your team: RDS or self-hosted?

If you are facing an RDS renewal, Extended Support charges on an old major version, a residency rule, or a need for superuser access and custom extensions, the short answer is this: RDS fits teams that want AWS to run the database and have few people to do it, while self-hosted PostgreSQL fits teams that need OS-level control, extensions RDS does not offer, or placement in Kubernetes or their own data center. Most organizations should decide on four drivers rather than on the monthly bill alone: staffing, high availability design, upgrade calendar and compliance evidence.

Staffing is the first driver. RDS moves patching, backups mechanics and failover hardware into AWS's hands, so a small platform team with standard extensions usually gains the most from it. Self-hosting shifts those tasks to your people, and the work recurs for as long as the database runs. Ask who on your team will own on-call for failover, restore drills and version upgrades before you commit to either path.

High availability design is the second. Multi-AZ on RDS is a managed standby, while a self-hosted cluster needs a failover tool such as Patroni or CloudNativePG, because PostgreSQL does not detect a primary failure on its own. Confirm your recovery time and data loss targets, then test failover in your own environment. Upgrade calendar is the third: PostgreSQL 14 is supported until November 12, 2026, so check which major version you run and whether the RDS upgrade or Extended Support path fits your plan. Finally, compliance evidence decides whether you can show auditors how access, backups and changes are controlled. Ask your auditor which artifacts they expect, and confirm with your AWS account team and your own environment what RDS can export for them.

Which scenarios favor RDS and which favor self-hosted PostgreSQL

This table maps common situations to the option that usually fits better, along with the condition that tips the decision. Read each row as a starting point and check the condition against your own team, network and compliance obligations before deciding.

ScenarioBetter fitCondition that decides it
Small team with no database administratorAmazon RDS for PostgreSQLNobody on the team can own backups, patching, failover drills and monitoring on a fixed calendar, so the managed service carries that work.
Need for an extension not on the RDS allowlistSelf-hosted PostgreSQLThe required extension is missing from RDS supported extensions for your engine version, and the workload cannot be redesigned around an allowed alternative. Confirm the current list in the RDS documentation.
Kubernetes platform team already operating clustersSelf-hosted PostgreSQL with CloudNativePGYour platform team already runs storage, monitoring and backup tooling on Kubernetes and can staff database operations as part of that platform.
Data must stay in a specific data centerSelf-hosted PostgreSQLYour residency rules require a named facility or operator control that RDS regions and account boundaries cannot meet. Confirm the exact region and support access model with AWS and your legal team.
Air-gapped or disconnected networkSelf-hosted PostgreSQLThe database must run with no route to AWS APIs, so RDS is not deployable in that environment. Plan package mirrors and offline backups for the self-hosted stack.
Planned major version upgradeDepends on upgrade controlRDS fits when AWS-managed upgrade windows suit your calendar. Self-hosted fits when you need to choose the timing and use pg_upgrade or logical replication yourself, with a rollback path you have tested.

How Multi-AZ, Patroni and CloudNativePG handle failover

PostgreSQL does not detect a failed primary or promote a standby on its own. The PostgreSQL failover documentation is explicit that automatic failover needs external tooling, so with self-hosted PostgreSQL the failover mechanism is a component you choose, deploy, test and operate. On RDS, Multi-AZ takes that responsibility off your hands: AWS runs the standby, detects the failure and switches the endpoint. What you give up is control over the failover logic, the timing thresholds and the exact promotion rules. Before comparing, ask your team to write down the recovery time objective and recovery point objective for each database, and confirm with AWS what RDS Multi-AZ failover behavior and recovery times apply to your engine version and instance class.

Patroni is the most established self-hosted option. It is MIT licensed and runs as a template around PostgreSQL that you configure for each cluster. It uses a distributed configuration store, which can be etcd, Consul, ZooKeeper or Kubernetes, to hold the leader lock, and it exposes a REST API for health checks, cluster status, switchover, failover and reinitialization. Its documentation also covers quorum commit for synchronous replication, which lets you decide how many standbys must confirm a commit. Your team owns the configuration store itself, its quorum, its own backups and its monitoring. Check how the store behaves when a node is partitioned, and rehearse both planned switchover and unplanned failover in a non-production environment before you rely on either.

CloudNativePG is an Apache-2.0 operator for Kubernetes and a CNCF Sandbox project. It uses the Kubernetes API server for failover, so no separate Patroni or configuration store is needed, and it supports quorum-based failover and synchronous replication. The trade-off is that your failover depends on the health of the Kubernetes control plane and the storage classes you provide. Confirm with your platform team whether your clusters meet the requirements for a stateful database, including node pools, persistent volume behavior and how node maintenance drains interact with the primary. Whichever option you choose, the failover path is only proven after drills that measure the actual time to a writable primary and the data loss, if any, under synchronous and asynchronous settings.

What data location, superuser access and compliance change

Moving PostgreSQL from RDS to your own servers changes who holds the keys, where data sits and who produces the evidence auditors ask for. Each card below is a decision or check that follows from that shift, and each one should be settled with your compliance and security teams before cutover.

Data location and residency

On RDS, data lives in the AWS Region you chose, but the control plane, snapshots and replicas are operated inside AWS's managed boundary. Self-hosted PostgreSQL places primary data, standbys, WAL archives and backups in the facilities you name, including on-premises or a sovereign cloud. Confirm where WAL archives and backup copies land, since object storage and off-site replicas are the usual gap. Map each copy to a residency requirement in writing.

Archiving docs

Superuser and OS access

RDS does not give you the PostgreSQL superuser role or shell access to the host, so administrative actions run through the RDS API and parameter groups. A self-hosted cluster gives your team superuser and operating system rights, which means the privileged access path must be designed, not assumed. Decide who holds superuser, how break-glass access is granted and logged, and how database and host administrators are separated.

Extension freedom

PostgreSQL is released under the PostgreSQL License, which allows use, modification and distribution without license fees. RDS offers a curated extension list, so an extension your application depends on may not be available there. On your own servers you choose the extensions, but you also own their patching, compatibility with each major version and their security review. Inventory every extension in use before you compare options.

PostgreSQL licence

Identity integration

PostgreSQL documents authentication methods including password, GSSAPI, SSPI, LDAP, RADIUS, certificate, PAM and OAuth, so you can tie database logins to your directory and single sign-on. Confirm which method your identity provider supports, whether group membership maps to database roles, and how service accounts authenticate. Retire MD5 password authentication, which PostgreSQL 18 deprecated in favor of SCRAM.

Authentication docs

Audit logging and evidence

On RDS, many logs and metrics are exposed through AWS services. On your own servers, you configure PostgreSQL logging, retention, shipping to a central log store and access reviews yourself. Auditors will ask for evidence that logs are complete, tamper-resistant and reviewed. DeployOpen can prepare these controls and collect the evidence, but independent auditors and certification bodies issue any audit report or certification.

Shared responsibility

RDS shifts host patching, hardware failure handling and much of the platform operation to AWS, while you keep schema, roles, queries and data. Self-hosted PostgreSQL moves those platform duties to your team or your implementation partner. Write a responsibility matrix covering patching, backups, restore tests, failover drills, access reviews and incident response, so no control falls between two parties.

Running PostgreSQL on EC2, Kubernetes or your own servers

Running PostgreSQL on EC2 keeps the familiar virtual machine model while you take over the database layer that RDS hides. Patroni, an MIT-licensed template for high availability PostgreSQL, runs on each node and uses a distributed configuration store such as etcd, Consul or ZooKeeper to elect a leader. Your team owns the instances, the EBS volumes, the backup target and the network paths between nodes and clients. Patroni supports PostgreSQL 9.3 to 18, so the version you run is your decision, not the cloud provider's.

  • Instances and storage: You size, patch and replace EC2 instances, and choose EBS volume types and IOPS yourself.
  • Distributed configuration store: etcd, Consul or ZooKeeper becomes another cluster to run, back up and monitor.
  • Backups: You configure WAL archiving and point-in-time recovery to S3 or another target, and you test restores on a schedule.
  • Failover and operations: Patroni's REST API handles health checks, switchover and failover, but your alerting and runbooks must use it.
  • Networking: You manage security groups, private subnets, TLS and client routing, including connection pooling with PgBouncer.

Confirm with your platform team which Patroni release line and configuration store they will standardize on, and how they will test a failover before go-live.

How the parts of a self-hosted PostgreSQL cluster connect

The diagram starts with application traffic entering a connection pooler such as PgBouncer, which forwards it to the primary. The primary streams changes to standbys using synchronous or asynchronous replication, and a failover tool watches the primary. With Patroni, a distributed configuration store holds the leader lock; with CloudNativePG, the Kubernetes API server handles this role. WAL archiving sends continuous backups to object storage in your own account, which makes point-in-time recovery possible. Check where each control plane runs and who can reach it.

Traffic, replication, failover and backup paths inside the client's network.

What each option costs to own, by component

Running PostgreSQL yourself moves cost from one invoice to several line items: compute, storage, backups, monitoring and people. Each card below names one component on either side, whether it is one-time or recurring, and what should go into a quote so the two options can be compared on the same basis.

Instance hours and compute

RDS bills instance hours for the database engine and its host, so the rate depends on instance class, Region and whether the instance is on demand or reserved. Self-hosted PostgreSQL pays for servers, VMs or Kubernetes worker nodes, which recur monthly or annually whether or not they are fully loaded. Ask for the instance class and vCPU and memory sizing used in each estimate, and whether reserved pricing is included. Confirm that the self-hosted node count covers at least one standby and any monitoring agents.

PostgreSQL versioning policy

Multi-AZ standbys and replicas

On RDS, a Multi-AZ deployment bills a standby instance and its storage as a recurring cost, and read replicas bill as separate instances. Self-hosted high availability needs a second and third node for Patroni or CloudNativePG, plus a distributed configuration store such as etcd on Patroni deployments. PostgreSQL supports hot standbys and both synchronous and asynchronous replication, so the choice of replication mode affects both cost and write latency. Ask whether the standby is billed in full or at a reduced rate.

High availability docs

Storage, IOPS and throughput

RDS bills provisioned storage, and depending on the storage type, IOPS and throughput may be billed separately. Self-hosted storage is usually block volumes, local disks or SAN capacity, billed per GB and per performance tier by your cloud provider or bought as hardware. Storage cost recurs, and a larger database raises both storage and replica storage. Ask the quote to state storage type, provisioned IOPS, growth assumptions and whether replica storage is counted separately.

Backups and point-in-time recovery

RDS automated backups and retained snapshots are billed by backup storage beyond the free allowance, and exports leave the service as extra storage charges. Self-hosted backups need an object store, a WAL archive and a tool such as Barman Cloud for CloudNativePG, and the archive grows with write volume and retention. Point-in-time recovery depends on continuous WAL archiving, which PostgreSQL documents as a requirement for that capability. Ask for the retention period, the size of the base backups and the cost of restore testing.

Continuous archiving docs

Data transfer and egress

RDS charges for data transferred out of AWS and sometimes between Availability Zones, which applies to replication traffic and to application traffic leaving the Region. Self-hosted PostgreSQL pays for network egress from your cloud or data center, and for cross-zone traffic if the cluster spans zones. Replication and backup traffic can be a larger share of the bill than the application queries themselves. Ask the quote to separate replication, backup and application egress so each line can be checked.

Extended Support and major upgrades

RDS charges Extended Support per vCPU-hour once a PostgreSQL major version passes standard support, which is a recurring cost that grows if the upgrade is postponed. Self-hosted PostgreSQL has no vendor surcharge, but the upgrade work is yours, and PostgreSQL 14 is supported until November 12, 2026. Logical replication allows a major upgrade with only several seconds of downtime, which is a one-time engineering effort per upgrade cycle. Ask whether Extended Support pricing is included in the quote and whether the upgrade is priced as a separate project.

Versioning policy

Monitoring and database administration time

Monitoring, alerting and on-call are partly covered by RDS through Performance Insights and CloudWatch metrics, which add their own charges, while self-hosted clusters need a monitoring stack, log storage and alert routing that you run. The largest hidden cost is database administration time for failover tests, patching, backup restore drills and capacity planning, which is recurring and is paid as salary or retainer. Ask for the number of hours the quote assumes per month and who performs failover testing and restore drills.

What a move from RDS to self-hosted PostgreSQL involves

The sequence moves a production RDS for PostgreSQL database to a self-hosted cluster you operate, with the schema, data and application connections verified at each stage before the old database is retired.

  1. Inventory extensions, roles and parameters

    The platform or database team lists every database, role, extension, custom parameter group setting and scheduled job on the RDS instance, and checks each extension against what the target PostgreSQL build and packaging provide. Some extensions available on RDS may not be available in your chosen packaging, so this list decides whether the target can run the workload. The step is done when the team has a signed-off inventory with a gap list and an owner for each gap.

  2. Build the target cluster and HA tooling

    The team builds the self-hosted cluster on EC2, your own servers or Kubernetes, then adds the high availability layer: Patroni with a distributed configuration store, or CloudNativePG on Kubernetes. The team also configures backups, WAL archiving and point-in-time recovery, and runs failover and restore drills before any data moves. The step is done when a planned switchover and a restore to a chosen point in time both succeed in a non-production environment.

  3. Enable logical replication from RDS

    The database administrator enables rds.logical_replication in the RDS parameter group, which requires an instance restart, then creates a publication on the tables in scope. The self-hosted cluster receives a subscription and performs an initial table copy while the source stays live. The team confirms that the subscriber keeps pace and that row counts and checksums match for sampled tables. Logical replication works across PostgreSQL major versions, so the target can run a newer release if the plan calls for it.

  4. Handle sequences and large objects

    Logical replication does not carry sequence current values or large objects in the way a full dump does, so the team copies sequence positions at cutover and migrates large objects with a separate method. Applications that rely on sequence values for ordering or identifiers need a tested offset or a freeze step. The step is done when every sequence on the target matches the source at the cutover point and large object counts and sizes reconcile.

  5. Test extensions and application behavior outside RDS

    Engineers run the application test suite and representative load against the target, including queries that use the extensions from the inventory. They check authentication settings, since PostgreSQL 18 deprecates MD5 password authentication in favor of SCRAM, and they confirm that connection pooling with PgBouncer or the operator's pooler handles the expected connection counts. The step is done when test results match baseline results and each extension gap has an accepted workaround or a documented decision.

  6. Cut over application connections

    The team stops writes or freezes the application for the agreed window, waits for the subscription to catch up, syncs sequences, and repoints connection strings, DNS or the pooler to the new primary. Rollback stays available until the team confirms that the new primary accepts writes and that replication from the target to any downstream system is healthy. The step is done when the application runs on the self-hosted primary with no errors in the database and application logs.

  7. Decommission RDS after verification

    After a stable period that the business owner approves, the team removes the subscription, takes a final backup of the RDS instance, and deletes the instance and its snapshots according to retention rules. Monitoring, alerting and backup verification move to the self-hosted stack, and the team updates runbooks and access reviews. The step is done when the RDS resources are gone, the final backup is stored and tested, and the operations documentation names the new owners.

How upgrades and support windows differ

PostgreSQL ships a new major version about once a year and supports each one for five years, so the upgrade calendar is set by the community rather than by a vendor's plan. Per the PostgreSQL versioning policy, version 18 was first released on September 25, 2025 and is supported until November 14, 2030, with 17 supported to November 8, 2029, 16 to November 9, 2028, 15 to November 11, 2027 and 14 to November 12, 2026. Version 14 is the first of these to leave support, so a self-hosted fleet still on 14 should have its path to 17 or 18 scheduled now. On RDS, the same versions move on AWS's calendar, and Extended Support charges apply to major versions past standard support, so confirm in the console and the RDS documentation which dates and charges apply to each engine version you run.

Minor releases carry no storage format change, so applying one means replacing the executables and restarting the server. The work is a routine change window, not a data migration. Major upgrades are different. The documented paths are pg_dumpall with a restore, pg_upgrade, and logical replication, which works across major versions and, per the upgrade documentation, can limit downtime to several seconds. PostgreSQL 18's pg_upgrade keeps planner statistics across the upgrade, which shortens the period of slow queries after cutover, and it adds parallel jobs and a --swap option. Test each path against a copy of your data, because the choice drives your rollback plan.

The trade-off is control against labor. Self-hosting lets your team choose the window, hold a version while a dependent extension is validated, and skip Extended Support, but every minor patch, major upgrade, rollback test and backup verification becomes a standing task with a named owner. Ask your RDS team to list which engine versions and Extended Support charges apply to your instances, then ask your self-hosting team to write the upgrade runbook and the rollback test before you commit to a cutover date.

Questions buyers ask before choosing RDS or self-hosted PostgreSQL

What does self-hosting PostgreSQL cost compared with RDS?

Self-hosting replaces one RDS bill with several cost lines you pay for separately: servers or Kubernetes nodes, storage and IOPS, backup storage, monitoring, data transfer, and the people who run the database. RDS bundles instance hours, Multi-AZ standbys, automated backups and, for old major versions, Extended Support charges. Self-hosting removes Extended Support because you choose the upgrade calendar, but it adds staffing time for patching, failover testing and backup restores. Most of the cost is recurring, while build and migration effort is one-time. Ask any provider for a quote that lists each component, the hours assumed for database administration, and how backup storage is sized. The companion page on cost by component walks through each line.

How long does a move from RDS to self-hosted PostgreSQL take?

The duration depends on database size, write volume, how many extensions and roles you use, and how much downtime the application can tolerate. PostgreSQL supports logical replication between different major versions, which is the basis for low-downtime cutovers, so a move can be planned around a short switch of application connections rather than a full dump and restore. Large databases take longer to synchronize and verify, and extensions that RDS offers may need testing on the target. No duration is given here because none was supplied for your environment. Ask for a written plan that names the replication method, the verification steps and the rollback path before agreeing a timeline.

Can an in-house team run self-hosted PostgreSQL without outside help?

Yes, many teams do, but the answer depends on whether they already operate PostgreSQL in production and have tested recovery. A team that can handle backups with point-in-time recovery, configure replication, plan major upgrades and respond to failover events can run it internally. Teams without that experience usually benefit from an outside plan, a hardened baseline and a runbook reviewed before go-live. Outside help can be scoped to a fixed deliverable, such as the design and first deployment, followed by a handover. Before deciding, list who will be on call, who performs restores, and who approves upgrades.

What skills does a self-hosted PostgreSQL platform need?

The core skills are database administration, operating system and storage administration, and backup and recovery testing. If you choose CloudNativePG, you also need working Kubernetes knowledge, including persistent volume claims, node scheduling and operator upgrades. Patroni on virtual machines needs a distributed configuration store such as etcd, Consul or ZooKeeper, which is another system to run. Backup testing is the skill most often underestimated: a backup that has never been restored is not a tested backup. Monitoring, connection pooling with PgBouncer and security patching also need an owner. Ask for a skills matrix that maps each duty to a named role, and confirm it with your own staff before committing.

Does self-hosted PostgreSQL meet audit and data residency needs?

Self-hosting can keep data in the region and accounts you choose, which is often the reason teams move. Whether it satisfies a specific audit depends on the controls you implement and the framework your auditor applies, not on the database alone. Prepare evidence for access control, authentication settings such as SCRAM password handling, encryption in transit and at rest, backup retention, restore test records, change records for upgrades and audit logging. Independent auditors and certification bodies issue any assessment outcome. DeployOpen prepares systems, controls and evidence for compliance assessments but does not issue audit reports or certifications. Confirm your specific framework requirements with your assessor before the design is fixed.

Should I choose Patroni or CloudNativePG for high availability?

Choose Patroni if you run PostgreSQL on virtual machines or bare metal and can operate a distributed configuration store. Patroni is MIT licensed, runs PostgreSQL 9.3 to 18, and exposes a REST API for health checks, switchover and failover. Choose CloudNativePG if your platform already runs on Kubernetes, since it manages persistent volume claims directly, uses the Kubernetes API server for failover without external tools, and includes PgBouncer pooling and backups through the Barman Cloud plugin. The Apache-2.0 license and CNCF Sandbox status are relevant for procurement. Test failover under load in both designs, because the operational model differs more than the feature list suggests.

How do I keep self-hosted PostgreSQL patched and supported?

PostgreSQL releases minor updates at least once every three months and a new major version about once a year. Each major version receives five years of support: version 14 is supported until November 12, 2026, and version 18 until November 14, 2030. Minor updates replace executables and restart the server without changing the storage format. Major upgrades use dump and restore, pg_upgrade, or logical replication. Your team owns the upgrade calendar, so plan a recurring window before a version leaves support. Confirm the minor release process, rollback steps and test environment with whoever will carry out the work.

How DeployOpen helps evaluate, implement or migrate

DeployOpen plans, implements, hardens, backs up, upgrades and documents self-hosted PostgreSQL inside your own infrastructure, whether that is EC2 instances in your AWS accounts, Kubernetes clusters, or your own servers. The work covers the choices this comparison raises: whether to run Patroni with a distributed configuration store or CloudNativePG on Kubernetes, how synchronous replication and quorum commit are set, how pg_hba.conf and the authentication method (such as SCRAM or certificate authentication) are configured, and how WAL archiving and point-in-time recovery are tested by actually restoring a copy. Each of these is agreed in a written scope before work starts, so you know which decisions are yours and which are ours.

For security, DeployOpen runs testing of the database and the paths that reach it, including network exposure, superuser and role privileges, extension inventory, connection pooling access, credential handling and backup storage permissions. For compliance reviews, we prepare the controls and evidence your auditors ask for, such as configuration baselines, access reviews, backup and restore records, and upgrade logs. DeployOpen does not issue audit reports or certifications; independent auditors and certification bodies do that. Ask any provider, including us, to show which evidence will exist at the end of the engagement.

Most engagements are fixed-scope, with deliverables and timelines written down before work starts. Retainers cover ongoing minor and major upgrades, monitoring follow-up and continuous testing, which matters because PostgreSQL 14 support ends November 12, 2026, and each major version has a fixed end date. A quote follows from the written scope, so the most useful first step is a short written description of your databases, recovery targets and compliance obligations.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.