Data services
Rivtor runs its own Postgres, Redis and storage on the same private network as your apps, so a query never leaves the data centre and app-to-database latency stays under 1 ms.
Data services are created when detection finds code that needs them, or when a service lists them under data in deploy.toml. Provisioning runs in parallel with the build and takes under 2 seconds. Their credentials are stored encrypted and injected as environment variables at runtime.
Injected variables
# Postgres
DATABASE_URL=postgresql://p_my_app:<password>@host.docker.internal:6432/p_my_app
DIRECT_DATABASE_URL=postgresql://p_my_app:<password>@host.docker.internal:6432/p_my_app
PGHOST=host.docker.internal
PGPORT=6432
PGDATABASE=p_my_app
PGUSER=p_my_app
PGPASSWORD=<password>
# Redis
REDIS_URL=redis://default:<password>@redis:6379
# R2 object storage (AWS_* aliases are set too)
S3_ENDPOINT=https://<account>.r2.cloudflarestorage.com
S3_BUCKET=rv-my-app
S3_REGION=auto
S3_ACCESS_KEY_ID=<key>
S3_SECRET_ACCESS_KEY=<secret>Postgres 17
- Each project gets its own database
p_<slug>and its own role with the same name and a random 32-character password. Other roles cannot connect to it. - Apps connect through PgBouncer in transaction mode on port 6432, so serverless-style apps such as Next.js do not exhaust connections. Each role is limited to 20 connections and a 60-second statement timeout.
DIRECT_DATABASE_URLis provided for tools such as Prisma that ask for one; in v1 it is the same asDATABASE_URL.- There is no public database endpoint. Use the db tool for queries, temporary connections and exports.
- Over the plan's size limit, the database becomes read-only until you free space or upgrade. Nothing is deleted.
- Databases never sleep, on any plan.
Redis 7
- Each project gets its own Redis on the project's private network, reachable at
redis:6379with a password. - Memory is capped at the plan's Redis size with the
allkeys-lrupolicy: when full, the least recently used keys are evicted. Use it as a cache and queue, not as the only copy of your data.
Object storage (R2)
- Each project gets a Cloudflare R2 bucket
rv-<slug>and an API key scoped to that bucket only. - It speaks the S3 API: point any S3 SDK at
S3_ENDPOINTwith regionauto. The same values are also set asAWS_*variables for SDKs that read those. - No egress fees, and files can be served through Cloudflare's CDN.
Sizes per plan
| Free | Hobby | Pro | Team | |
|---|---|---|---|---|
| Postgres | 1 GB per project | 5 GB total | 20 GB total | 80 GB total |
| Redis | 50 MB | 100 MB | 256 MB | 1 GB |
| File storage | 1 GB | 10 GB | 50 GB | 200 GB |
| Point-in-time backups | 7 days | 14 days | 30 days | 30 days |
| Database branches | No | No | Yes | Yes |
Backups
Postgres is archived continuously (write-ahead log) with nightly base backups, so a database can be restored to any point in the backup window of its plan: 7 days on Free, 14 on Hobby, 30 on Pro and Team. Every week a random database is restored automatically to prove the backups work.
Export
Your data is yours. Download a standard dump at any time:
npx rivtor db export -o my-app.dumppg_restore --no-owner -d postgres://localhost/my_app my-app.dumpnpx rivtor db query "select …" or the db tool. They run in a read-only transaction with a 5-second timeout and return up to 500 rows.