Docs / Concepts
Scale to zero
A database that is not in use is released. While released it makes no bucket requests; its next query activates it.
- Works
- Release after 30 s without use. Zero bucket requests while released. Activation on the first request. Readiness checks that do not wake a database.
- Differs
- The first request after a release is slower, because it activates the database.
- Missing
- A published activation latency for your deployment. A qualification above 1,000 databases.
- Operational impact
- Listing databases and
GET /db/<name>/readydo not activate a database. A SQL statement does. A scheduled backup does too. - Evidence
- The project's own run at 1,000 databases. Larger qualifications are planned.
#What happens
A node serves many named databases. A database that has gone 30 seconds without use is released: its owner writes what it must and lets go. From then on the database makes no bucket requests. Its incremental idle footprint is the bytes it already has in the bucket.
The next request for that database activates it on some node. That request is slower than the ones after it.
| State | Meaning |
|---|---|
| Released (idle) | No current owner. No bucket requests. Healthy |
| Activating | A node is loading it for a request |
| Serving | A node owns it and answers requests |
A released database is not down. It has no owner because it needs none.
#What does and does not wake a database
| Action | Activates it? |
|---|---|
| A SQL statement over PostgreSQL wire or HTTP | Yes |
GET /db/<name>/ready with the database token |
No |
gauntlet admin list |
No |
| A scheduled backup | Yes, today. Backups that skip idle databases are planned |
This matters for tools: a dashboard or agent that lists a fleet must never run a query per database to do it.
#What "free while idle" does and does not mean
- It means the database's incremental cost is its stored bytes: no polling, no heartbeats, no bucket requests.
- It does not make a machine you run free, or an allocated node, or the bucket's storage bill.
- Storage only grows in pre-beta. Deleted rows and dropped databases are not reclaimed yet.
#How far this has been shown
The project's own evidence is a run with 1,000 databases on one deployment. In that run the first query against a released database took about 250 ms at the median. That is one deployment's measurement and not a promise for your hosts and bucket. Measure activation on your own deployment.
Qualifications at 100,000 and at one million databases are planned and have not been run. The bytes and object count of one empty database are not yet published.