Read replicas
A replica is a second compute on the same data as its primary, read only. It adds capacity for reads without copying anything.
peat replica orders orders-reador
apiVersion: peat.zabaca.com/v1alpha1kind: Databasemetadata: name: orders-readspec: replicaOf: orders- It is reached like any database: by its own name, with a Secret
orders-read-loginholding the primary’s login. - It lags the primary slightly, as any streaming replica does. A write is refused with Postgres’s own error (“cannot execute … in a read-only transaction”).
- It sleeps and wakes on its own. Waking a replica does not wake its primary. A woken replica takes its first connection only once it has caught up with every write the primary had acknowledged before the wake.
- It runs its primary’s Postgres version. To move the primary to a newer version, delete its replicas, move it, and make them again.
- A replica of a replica, or a branch of one, is refused. Make it from the primary.
- Deleting the primary waits until its replicas are deleted.