Cloud Economics
Managed database vs self-hosted database cost for PostgreSQL
Compare managed and self-hosted PostgreSQL by pricing the same workload, backup retention, and recovery targets on Amazon RDS for PostgreSQL and Amazon EC2. Then add the staff time each option requires. Self-hosting costs less when its infrastructure savings exceed its additional operating labor. If the self-managed infrastructure quote is lower, divide the monthly savings by your loaded hourly staff cost to find the break-even number of additional staff hours.
Match the PostgreSQL workload before pricing it
The modeled workload is an always-on application database in AWS US East (N. Virginia). It uses a primary PostgreSQL instance with no standby and assumes recovery from backup is acceptable. Both options use the same PostgreSQL major version, application query mix, and peak traffic. Each has a modeled 50 GB of provisioned database storage, the same gp3 volume size AWS uses in its RDS for PostgreSQL zero-ETL pricing example. Amazon RDS for PostgreSQL pricing
| Requirement | Managed on Amazon RDS | Self-managed on Amazon EC2 |
|---|---|---|
| Database workload | Run the same queries against the same starting dataset and PostgreSQL major version. | Run the same workload and check it against the same peak latency target. |
| Starting instance size | Pick an RDS instance class for the test and record its vCPU and memory allocation. | Start with comparable vCPU and memory and test against the same latency target. |
| Backup and recovery | Price the retention policy and run a restore drill against the application’s recovery targets. | Price the backup destination, retention, and restore drill against those same targets. |
| Application placement | Keep application traffic in the same Availability Zone for the baseline. AWS lists same-zone RDS-to-EC2 data transfer as free. Amazon RDS pricing | Model the application and database in the same Availability Zone and price the actual network path. |
Treat these instance sizes as starting points. Before committing to either bill, replay representative reads and writes through a peak period. Record query latency, storage performance, and whether the application can reconnect after a restore. If either deployment misses its target, change its configuration and rerun the comparison with the configuration that passes. For workloads that require failover, build a separate comparison. AWS describes a Multi-AZ RDS configuration with a standby in a different Availability Zone and automatic failover. Amazon RDS for PostgreSQL pricing Price a self-managed design against the same recovery targets before comparing its bill with Multi-AZ RDS.
Compare compute quotes on the same basis
Get an On-Demand quote for each configuration in AWS US East (N. Virginia). Use the same estimate period and the runtime you expect from the always-on workload. AWS charges for RDS On-Demand compute for the time the DB instance runs and lists storage and backup charges separately. Amazon RDS pricing
| Quote input | Amazon RDS for PostgreSQL | Self-managed PostgreSQL on Amazon EC2 |
|---|---|---|
| Compute rate | Record the quoted rate for the tested instance class and the modeled Single-AZ deployment. | Record the quoted rate for the tested instance type and include any other instances the deployment needs. |
| Monthly compute | Multiply the quoted hourly rate by the modeled hours for the DB instance. | Multiply the quoted hourly rate by the modeled hours for each instance and add the resulting amounts. |
| Quote record | Save the quote date, AWS region, billing term, and deployment option. | Save the quote date, AWS region, billing term, and instance configuration. |
Check that both quotes use the same currency and keep the compute subtotal separate from the rest of the bill. Record the dates on which you obtained the quotes so another reader can reproduce the comparison. For related context, see the ByteCosts cloud comparison and pricing snapshot date vs evidence date.
Calculate the staff-time break-even
Use the difference between the complete provider bills as the budget for additional self-managed work. Itemize database storage, backup storage, network traffic, and any additional instances for each option. For RDS, account for the retention period and snapshots you plan to keep. AWS lists both as inputs to backup storage consumption. Amazon RDS for PostgreSQL pricing Include any storage needed for the EC2 host alongside the database volume and backup destination in your self-managed quote.
| Cost or input | How to calculate it |
|---|---|
| Monthly infrastructure savings | Managed provider bill minus self-managed provider bill. |
| Additional self-managed staff hours | Self-managed database operating hours minus managed database operating hours, per month. |
| Additional monthly labor cost | Additional staff hours multiplied by your own loaded hourly staff cost. |
| Monthly savings from self-hosting | Infrastructure savings minus additional labor cost. |
For a sensitivity check, calculate how many extra hours your team could spend on EC2 before its lower infrastructure bill stops saving money. When the self-managed quote is lower and you use the same positive loaded hourly rate for both setups, divide the monthly infrastructure savings by that rate. At the threshold, estimated monthly costs are equal. Above it, RDS costs less. Below it, EC2 costs less. If self-managed backup or storage costs rise, recalculate the allowance using the revised bill.
For the staff estimate, assign an owner and expected effort to each task for both deployments. Start with patching, monitoring, backup verification, restore drills, and incident response. Include query tuning and application-side troubleshooting in both columns if your team still owns those tasks. Spread occasional tasks across the budget period so a quiet on-call month still carries its share of scheduled work. Use your team’s loaded cost to reflect the people who will do the work.
Track migration separately from recurring operations. Estimate the time for rehearsals, data validation, cutover, and the period when both systems are running. If monthly savings are positive, divide the one-time migration cost by those savings to estimate the payback period. Use the same cost categories when comparing database hosting with the rest of your application’s infrastructure. Vercel, AWS, and Railway cost comparison
What Hivekit and Nhost changed
In a case study submitted to Hacker News on April 4, 2024, Hivekit reported replacing $10,000 per month in Amazon Aurora instances with a $200 per month Amazon Elastic Block Store volume. Hivekit case study
Hivekit said the custom storage engine ran inside its existing server binary and the server’s running cost stayed the same. It also said it could tolerate losing about one second of buffered location updates during a server failure and takeover. Hivekit case study The case study gives no development cost for the engine. In the discussion, RHSeeger asked about implementation and maintenance time, and bawolff pointed out that the figures omitted development costs. Hacker News discussion Treat the figures as reported costs for Hivekit’s storage redesign when deciding which costs to include in your PostgreSQL comparison.
On September 26, 2022, Nhost announced dedicated PostgreSQL instances on Kubernetes for new projects. It described its earlier Amazon RDS for PostgreSQL setup as sharing regional database instances across projects and cited resource contention, demand for direct access as the postgres user, and extension restrictions. Nhost announcement Nhost also described the work to provision, operate, and scale the replacement and gave no before-and-after costs in the announcement. Nhost announcement Use the case to identify requirements to test and price, especially tenant isolation and the privileges the application needs.
Make the decision with a matched quote
Start with the application’s recovery requirements and choose a configuration on each side that can meet them. Save each quote with its region, instance class, PostgreSQL version, storage configuration, backup retention, and billing term. Then list the estimated staff hours beside each quote and run a restore drill for both deployments. A measured restore gives the team a basis for revising the schedule and effort in the budget.
If self-hosting still saves money after those adjustments, compare the monthly savings with the work required to move the database. If a small increase in labor erases the savings, the decision depends on who covers scheduled maintenance and incidents. Record that threshold with the budget so the next person can see which assumption would change the decision.
Sources
- Amazon RDS pricing (Amazon Web Services, undated capture with a 2026 copyright footer)
- Amazon RDS for PostgreSQL pricing (Amazon Web Services, undated capture with a 2026 copyright footer)
- How we’ve saved 98% in cloud costs by writing our own database (Hivekit, undated page; submitted to Hacker News April 4, 2024)
- Saving cloud costs by writing our own database (Hacker News, April 4, 2024)
- Individual PostgreSQL instances to everyone (Nhost, September 26, 2022)
How this note was produced
Drafted with AI assistance from committed ByteCosts pricing snapshots and deterministic cost formulas. Figures are grounded in the linked sources (last updated 2026-11-30). Read our editorial & automation policy, inspect the methodology, or report a discrepancy.
Managed database vs self-hosted database cost for PostgreSQL. ByteCosts. Updated 2026-11-30. https://bytecosts.com/blog/managed-vs-self-hosted-database-cost/