Lifecycle & economics
Managing the lifecycle of many short-lived databases — TTL, cleanup, suspend/resume, and the scale-to-zero math.
When agents create databases freely, the questions that matter are when does each one go away and what does it cost in the meantime. This page covers the lifecycle controls Silos gives you and the economics that make many short-lived databases sensible.
States in a database's life
A Silos database moves through a small set of states:
Active
A runtime is serving queries. This is the only state that bills compute.
Idle (scaled to zero)
No traffic, so the runtime has spun down. Durable state stays in storage; no compute is billed.
Suspended
Explicitly paused via the API or CLI. It won't wake on a query until you resume it.
Deleted
Removed entirely. Storage is released and billing for it stops.
Idle and active transitions are automatic — a database scales to zero on its own when traffic stops and cold-starts on the next query. Suspend, resume, and delete are explicit actions you (or your agent) take.
Cleaning up
The cardinal rule for agent workloads: delete what you create. Leaving databases allocated after a task is the main way ephemeral usage turns into unexpected storage cost.
When the work is done and the data isn't needed, delete the database:
silos db delete agent-task-8f3acurl -X DELETE \
"https://api.silos.sh/v1/projects/{project_id}/databases/{database_id}" \
-H "Authorization: Bearer $SILOS_API_KEY"When you might need the database again soon but want it inert in the meantime, suspend it and resume later:
silos db suspend agent-task-8f3a
# ...later...
silos db resume agent-task-8f3aTTL: expire databases automatically
For fire-and-forget tasks, it's safest not to rely on an agent remembering to clean up. Treat each ephemeral database as having a time to live and reap expired ones with a scheduled sweep — list databases, find the ones past their TTL by name or creation time, and delete them:
# Delete task databases older than their intended lifetime.
silos db list --json \
| your-filter-for-expired \
| while read -r db; do silos db delete "$db"; doneEncode intent in the database name (for example a run ID or a timestamp) so a sweeper can identify what's safe to delete without extra bookkeeping.
The scale-to-zero math
The reason many short-lived databases are affordable: compute is billed only while a database is actively serving queries. A database that an agent created an hour ago but isn't currently using has scaled to zero and costs nothing in compute — you carry only its storage until you delete it.
That changes the calculus versus always-on servers:
- 100 mostly-idle agent databases bill compute only for the slices of time they're each actually queried — not for 100 servers running 24/7.
- The cost you do keep paying for an undeleted idle database is storage, which is why deleting (or TTL-reaping) finished databases matters.
The trade-off is the cold start: the first query after idle pays to materialize the database. For agent tasks this is usually fine; for latency-critical user paths, keep a database warm.