Databases
4 min read
One Database per Tenant
A tenant can have one database, chosen when the tenant is created and shared by all of its services. It runs inside the tenant's own namespace, so no other tenant can reach it. A tenant can also have none: connect to a database you run elsewhere by setting DATABASE_URL yourself.
| Database | Versions | Use it for |
|---|---|---|
| PostgreSQL | 17 (default), 16 | Your application's data |
| MySQL | 8.4 | Your application's data |
| Valkey | 8.0 (default), 7.2 | Caches, queues and sessions. Redis-compatible |
What Your App Receives
Staxa sets the connection details as environment variables on every service of the tenant. You do not add them yourself, and they take precedence over a variable of the same name that you set.
- PostgreSQL and MySQL:
DATABASE_URL,DB_HOST,DB_PORT,DB_NAME,DB_USERandDB_PASSWORD - Valkey:
REDIS_URLandREDIS_PASSWORD. A password is always required
Backups
PostgreSQL and MySQL are backed up every night. A database that is asleep or paused at that time has no pod to back up, so it is backed up once it is awake again.
Valkey is not backed up. It is a cache-grade store: it saves periodic snapshots and keeps no append-only log. Its data survives a normal restart, a crash can lose the last few minutes of writes, and anything lost with its volume is gone. Keep nothing in Valkey that you cannot rebuild.
Reaching the Database from Outside
By default only the tenant's own services can connect. To connect from your own machine or another system, add an inbound rule for the database in the tenant's Network tab and name the IP addresses allowed. See Network Rules.
Changing or Removing It
The engine and version are set when the tenant is created and cannot be changed afterwards. Deleting the tenant deletes its database.
More in Deployments
Still have questions?
Chat or email and a person will answer, or look it up in the API docs.