Database States: State Machine

Stable

How to interpret database states and autoscale phases in SPG99.

Updated: March 21, 2026

The Control Plane returns the state field for a database. This is the main indicator of what is happening to the resource right now. But in the new model, it is useful to look at both state and scale_state.

Main state values

creating

The database is being created: the catalog and storage entities are still being prepared.

booting

The writer is starting. This is a normal cold-start state.

ready

The database is running and ready to accept connections.

stopping

The platform is stopping the writer.

stopped

The writer is off. The next connection through Gateway can wake the database up automatically.

terminated

A compatibility alias for the stopped state: the database is inactive.

deleting

The resource and its storage entities are being deleted.

error

An error occurred during startup, stop, bootstrap, or handoff.

Autoscale phases in scale_state

If state describes the lifecycle of the database as a whole, scale_state describes the writer autoscaler specifically.

STEADY

The normal steady state. No handoff is in progress.

PREPARING

The platform is preparing a candidate writer for a new profile.

FREEZING

Gateway receives the command to stop issuing new checkouts to the old writer.

DRAINING

The system is waiting for active load to finish so that the writer can be switched safely.

STOPPING_OLD

The old writer generation is stopping.

STARTING_NEW

The new writer generation is starting or being brought to readiness.

SWITCHING

The Control Plane switches the catalog and control state to the new writer.

COOLDOWN

A protective pause after handoff, so that the writer is not flipped back and forth immediately.

FAILED

The transition failed. You need to inspect scale_failure_reason, logs, and metrics.

How to read this in practice

  • state=ready + scale_state=STEADY — the database is simply working.
  • state=ready + scale_state=DRAINING — the database is still working, but the platform is already preparing a controlled handoff.
  • state=stopped + scale_state=STEADY — the database is sleeping and waiting for the next connection.
  • state=error or scale_state=FAILED — Monitoring / Logs are required.

Main rule

Do not treat stopped — and not even freeze_new_checkouts=true — as an automatic incident. In SPG99, these are part of the normal serverless and autoscale model.