FinOps · CockroachDB
CockroachDB cost optimization: one replication factor for everything, reads that cross regions, and nodes bought for the peak.
CockroachDB is wire-compatible with Postgres and costs like nothing else in this section: every row is stored several times. This is the FinOps view of that multiplier, of reads that cross regions, and of capacity bought for a peak.
A bill with a multiplier built in
One replication factor for everything. Reads cross regions all day. We bought nodes for the peak. CockroachDB is built to keep several copies of every range in several places, and that is what makes it a different animal from the Postgres engines around it. It is also what makes the costs different. Storage is a multiple of the data. A read can be a network journey. And a self-hosted cluster is billed for the capacity reserved, not the capacity used.
The consequence is that the storage on the invoice is not the size of the data. This page is the CockroachDB chapter of Postgres FinOps, and it begins with the replication factor before it gets to anything else. How the platform reads ranges, leaseholders and survival goals on their own terms is on the CockroachDB solutions page, and the shared method is in the cost optimization overview.
How CockroachDB meters a month
A self-hosted cluster bills as the machines do: each node by the hour, with its own vCPUs and its own disk. Underneath sits the replication factor, and over it the survival goal. A region-survival goal takes the replicas of a three-region database from three to five. The rows below say what each meter counts and how it behaves. None is a price.
-
Replication factor
- Behaviour
- multiplies
- What it means for the bill
- Every range is stored as several replicas. The default is three, and it can be set for a database, a table, an index or a row range with zone configurations. On a self-hosted cluster each replica sits on a node’s disk, which is paid for whether it is full or not.
-
Survival goal
- Behaviour
- multiplies
- What it means for the bill
- Surviving a region failure on a three-region cluster raises the replicas of the database from three to five, and writes wait for a nearby region as well. A zone-failure goal is the default.
-
Provisioned nodes
- Behaviour
- multiplies
- What it means for the bill
- On a self-hosted cluster the machines are the bill: the vCPUs of each node multiplied by the node count, hourly, and a disk on each node of the same size. Billing follows the capacity provisioned, not the capacity used.
-
Row history window
- Behaviour
- metered
- What it means for the bill
- Old versions of rows are kept for a garbage-collection window, four hours by default. A larger window keeps more storage, and a smaller one saves disk where rows are overwritten often.
Replication factor, table by table
A replication factor is a zone configuration, and a zone configuration can apply to a whole cluster, a database, a table, an index or a range of rows. The default is three, and the system data is kept at five. The design lets a cluster treat precious data and disposable data differently. In practice, a database gets one setting at creation and every table inherits it, including the ones that could be rebuilt from somewhere else in an afternoon.
The tiles set the data held against the storage paid for. The multiple is the point: the data you hold is a fraction of the storage you pay for.
Replication factor as a storage multiplier
illustrativeA self-hosted cluster. The data held is a fraction of the storage paid for.
Data held
about 3 TB
Storage paid for
about 9 TB
Stored as a multiple of the data
about 3 times
Reads that cross regions, and where they come from
On a multi-region cluster every table has a home. By default tables are homed in the database’s primary region, and a plain read goes to the leaseholder of the range it wants, wherever that is. So a service in Frankfurt reading rows homed in Virginia pays for the distance in latency.
There are three ways out for the lookups: home the rows with the region that reads them, serve read-mostly data from a global table, or take a stale read from the nearest replica where staleness is acceptable.
Provisioned vCPUs, against the busiest node
On a self-hosted cluster the unit is capacity. Each node is billed by the hour: its vCPUs, multiplied by the number of nodes, with a disk on each node of the same size. There is no discount for a quiet night, so what matters is how close the busiest hour comes to the capacity.
Removing capacity from a distributed database is not free of constraint, because placement and survival requirements set a floor, so any reduction is a number to check, not a number to act on.
Four problems, in the words people use for them
These are the sentences from the review. Each card links to the page where that part of the platform is covered in depth.
What the product shows: The replication, cross-region and node costs, each priced and tied back to the table or statement that drives it.
Reads cross regions all day.
We bought nodes for the peak.
Old row versions keep eating the disk.
Where the rest of the method lives
CockroachDB and YugabyteDB are the two distributed engines here, and they share the shape of their cost, a replica count that multiplies the data, while differing on what meters it. The method does not change: attribute the dollars, queue and gate the fixes, put each number in front of its owner, and read every figure against the basis it carries. For why a copy count is a different kind of cost from a usage count, read how Postgres cost works on a fleet.
Questions about CockroachDB cost
On a self-hosted cluster, does a replication factor of three mean paying three times for storage?
Yes. Each replica occupies a node’s disk, so the storage held is the data multiplied by the replication factor, and the disks are paid for whether they are full or not. The replication screen on this page shows that multiple.
What does surviving a region failure cost?
On a cluster with three regions, CockroachDB documents that the region survival goal raises the number of replicas of the database’s ranges from three to five. It also raises write latency by at least the round trip to the nearest region, and it needs at least three regions. That is a worthwhile price for databases that must survive a region and an expensive default for those that do not.
Will it change a zone configuration for me?
No. A replication factor or a table locality change is a recommendation with its dollar delta and its basis. A person approves it and the ledger records who did. A zone configuration change moves data between nodes, and it goes through the approval gate like any other change.
See what each CockroachDB table costs in copies.
A pilot starts read-only and shows the replication multiplier per table and provisioned nodes against the busiest hour, all modeled and labelled with their basis.