Skip to content
dbexplore

Cost

How Postgres cost works on a fleet

For anyone who has to explain why a Postgres bill moved, and needs one vocabulary that holds across clouds.

How cost works on a Postgres fleet: the three billing regimes, what each one meters, where each leaks, and why every figure has to name its basis.

Reference page, revised in place. Last updated .

A bill is a sum of meters

A Postgres bill is not a price for a database. It is several meters added together, and which meters exist depends on how the database is sold. The same workload can leak money in one place on one platform and nowhere on another, so cost work starts by establishing what is metered, not what is slow.

Three regimes cover almost every fleet. Most real fleets contain all three.

Provisioned managed: Amazon RDS, Google Cloud SQL

In a provisioned service, an instance class and a storage size are chosen up front, and they are billed whether or not the database is busy. Amazon RDS prices a DB instance by the hour it runs. Storage is priced on the size allocated, not the data held, and RDS documents that allocated space cannot be deallocated, so a volume only ever grows until the data is moved onto a smaller one. Provisioned IOPS are charged as provisioned resources “whether or not you use them”, in the words of the documentation.

High availability is a second copy of the compute. In an RDS Multi-AZ deployment every instance, standby included, is billed as an instance. Google Cloud SQL documents that a high-availability instance costs twice as much as a standalone one. Where that doubling, multiplied across replicas, tips the choice towards AlloyDB is worked through in Cloud SQL or AlloyDB.

Support is a meter too. RDS Extended Support for PostgreSQL major versions past community end of life is priced per vCPU-hour and billed separately from the instance charge, so an unplanned version age becomes a line on the invoice.

Consumption-metered: Aurora Serverless, Neon

A consumption-metered service bills capacity over time instead of a fixed size. Aurora Serverless measures capacity in Aurora capacity units, samples it every second, and charges in ACU-hours. Neon charges compute in CU-hours, defined as compute size multiplied by hours running, and states that a suspended compute does not accrue them. Storage on both is billed on what is used. Aurora charges for the space in use in the cluster volume, and Neon bills in GB-months measured hourly.

The consumption model has a floor that is easy to forget. An Aurora Serverless cluster is configured with a minimum capacity, and an idle cluster consumes approximately the number of instances times that minimum. Setting the minimum to zero enables pausing on supported engine versions, with conditions: an open user connection, logical replication, an RDS Proxy or the primary of a global database each prevent a pause.

Where the regimes blur

Aurora with provisioned instances is not purely either one. Compute is billed as instances. Storage is billed on use. And on the Standard storage configuration, I/O is billed per request, while on I/O-Optimized there is no per-request I/O charge. The break-even between those two depends on how much of the total spend I/O represents, which is a property of the workload and not of the cluster size.

A read replica adds another instance, and in a serverless cluster a reader in the first two promotion tiers follows the writer’s capacity rather than scaling by itself. Topology therefore sets cost as much as workload does, which is why topology discovery comes before any pricing.

Self-hosted

On virtual machines or Kubernetes the meters are the host, the disk, the network between zones and the backup storage. They are visible on an invoice but rarely attached to a database, because the host runs other things. The one cost that never appears on any invoice is engineer time: upgrades, failovers, restores and the on-call rota.

Self-hosting leaks in capacity sized years ago and never revisited, disks that hold bloat still being paid for, and standbys kept for a failover that has never been exercised.

Leaks that cross every regime

Some costs follow the data, not the platform.

Indexes and bloat. Every index occupies storage and is written on every insert and non-heap-only update, and those writes become WAL that standbys replay. A table with dead rows occupies more pages than it needs. How to find the indexes nothing reads is in unused and missing indexes, and the mechanics of space that is not returned are in autovacuum and bloat.

Retention. Backups, WAL archives and snapshots are priced by volume and time. A longer window is a larger meter.

Movement. Data that leaves the database or crosses a region can be metered separately. Neon bills public network transfer, including data sent by logical replication, and an Aurora global database meters the writes replicated to a secondary region as a line of their own.

Which of these matters on a given platform depends on the regime, not on Postgres. Dropping an unused index returns storage charges on a platform that bills storage on use, and returns none on one that bills allocated size. The write overhead is saved in both.

From an invoice line to a query

A bill line names a resource: an instance, a cluster, a volume. The chain beneath it runs from resource to database to workload to statement, and each step down loses authority. The invoice is exact about the instance. A statement’s cost is a calculation: a share of a pool, computed from counters such as execution time, blocks read and WAL written. That is an allocation, and an allocation always sums to the pool it divided, which is why it can never disagree with the bill in total and can still be wrong in every part.

Every figure has a basis

A cost figure rests on a basis, and a figure that does not say which cannot be checked. These are the ones you meet first.

  • List price. The public price for a region and engine. It is the default for any estimate, and it changes, so a stored list price needs a date.
  • Your own rate. Negotiated discounts, commitments and reserved capacity applied to the list. This is the figure finance recognises.
  • Your bill. The charge the vendor actually made, read back from the invoice or a cost export.

A figure computed from counters and one of the first two is modeled. A figure read from the third is billed. They are not interchangeable. Modeled spend ignores credits, taxes, amortised commitments and billing-period boundaries, and when the model and the bill disagree, the bill is right and the model is what needs correcting. A saving counts as realised only when the period after the change shows it, from a bill or from telemetry, so before then it is a forecast and should be labelled one.

Four questions sort most disputes about a number. Which meter does it come from? Which basis does it rest on? Over what window was it measured? Is it an average cost or the cost of the next unit removed?

Put every Postgres you run on autopilot.

We onboard teams in small batches. Tell us about your fleet and we will reach out when a seat opens. One email, no drip campaign.