Databases
Postgres and Redis for your apps: creating one, connecting an app, and what happens to the data.
CloudJod runs two kinds of database for your apps. You never install, patch or configure the server, and your app is handed its connection string.
| PostgreSQL 18 | A relational database: durable, transactional, the default choice. 0.25 CPU, 256 MiB of memory and a 2 GiB disk. |
|---|---|
| Redis 7 | An in-memory store for caching, queues and sessions, saved to disk so a restart does not empty it. 0.1 CPU, 128 MiB and a 1 GiB disk. |
Both count against your plan like an app.
Create one
Open Databases, or the project it belongs to. Under
New database, choose the kind, give it a name (such as
main-db) and the project whose apps use it, and press
Create. It shows running once its server is up; a
new Postgres takes a few seconds longer the first time while it prepares its
disk.
Connect an app
Press Attach beside the database and choose the app. At its next deploy the app is given a connection string in its environment:
| Postgres | DATABASE_URL, such as postgres://cloudjod:…@addon-main-db:5432/app |
|---|---|
| Redis | REDIS_URL |
An app with two databases of one kind keeps DATABASE_URL for the
first and gets a second variable named after the other, such as
DATABASE_URL_REPORTS_DB, rather than having the first one
replaced. The password is generated for you
and kept sealed, and the variable is not listed on the app's Environment tab:
it is put together each time the app deploys. One-off and release commands
get it too, so a migration reaches the database it migrates.
A database belongs to one project, but apps in other projects can attach it too, such as a reporting tool reading the shop's database. The Used by column says which apps read each one. To move a database to another project, use Move to… beside it on its project's page.
Where they run
Databases run on CloudJod's own servers, even in a project whose apps run on your own servers. A database's data lives on the disk of the machine it was created on, so it is never put on a machine you attached: an app there reaches it over CloudJod's encrypted network. Nothing outside your organization can connect to them: they are not on the internet.
Keeping your data safe
- Stopping an app, or your organization being suspended, stops its databases but never deletes their data.
- Deleting a database keeps its disk for a grace period (a week on a standard installation) before it is destroyed.
-
Back up what matters to you as well. A
scheduled command on an app attached to
the database can run
pg_dump "$DATABASE_URL"each night and send the result to storage you control.
Next: One-click apps