Skip to content
cloudhost
Database

A SQL database that sleeps when idle.

Connect with any SQL client or an HTTP request. It wakes on the first connection, grows under load and stops when idle; you pay for its compute time and its data. Branch it, go back in time, send reads to replicas.

What you get

  • Any SQL client

    psql, pg, Prisma, Drizzle and any other SQL driver, over an encrypted connection. Your existing code does not change.

  • On with a connection, off when idle

    The first connection wakes the database and later ones share it. When idle it sleeps, and the data stays. So the first visitor never waits for it to wake, switch an environment to always on; it is then charged as usage around the clock.

  • Autoscaling

    Each database grows under load and shrinks after it, with no restart and no dropped connection, between a minimum and maximum you set: 0.25 to 8 CU, each CU one vCPU and 4 GB of memory.

  • Read replicas

    Up to 4 per environment, on the same data. Same host, with the database name plus _ro; connections are spread over them, each replica autoscales on its own, and you see each one's lag as it happens.

  • Fast wake

    A sleeping database is ready again in a second or two, so the first request after a quiet night is not left waiting.

  • Branches

    A full copy of the database in a moment, without copying the data: from its latest state or any time in its history. For tests, migrations or reports.

  • A branch per preview

    Each app or function preview gets its own database branch, removed with the preview. Production data stays safe.

  • Restore to a point in time

    Bring a branch back to its state at any moment in its history. The state before is kept as a backup, so a restore can be undone too.

  • History by plan

    Every database keeps 7 days of history.

  • env.DB in functions

    Bind a function or app to the database and run SQL with no connection string or password; send reads to the replicas with env.DB_RO.

  • SQL over HTTP

    Where a lasting connection is not possible, send a SQL statement and its parameters in one HTTPS request and get JSON back. Several statements together run in one transaction.

  • Extensions

    `pgvector` for vector search, `postgis` for geodata, `pg_trgm` for text search, plus `uuid-ossp`, `citext` and `hstore`, each one CREATE EXTENSION away.

  • Table changes to Realtime

    Every insert, update and delete on the tables you choose goes to a channel once it commits, and every connected browser gets it at once. While it is on, the database stays awake.

  • Thousands of short connections

    A second connection string on port 6432 is for serverless functions and apps that open many short connections; the database is not swamped by them.

  • An IP allow-list

    Limit connections to the addresses and ranges you list; it is checked before the password. Your own code on the platform, through env.DB, always gets through.

  • Backups and export

    History is kept continuously, with a copy at a second provider inside Iran. Take everything elsewhere over a normal connection whenever you like.

  • Observability

    Compute time, the current size, data size, connections, replica lag, cache hit ratio and your most frequent SQL statements.

  • A narrow role

    Your database user can do anything with its own data, and has no way into the server or anyone else's database.

Create, connect, branch, scale

Every branch has the same host; only the database name in the connection changes: branch--database, and the same name with _ro for its replicas.

cloudhost databases create main --project shop
# host     db-3f9a2c1e7b6d4a05.database.trustpage.ir:5432
# user     app
# password shown once

Pay for work, not for a server

Compute counts only while the database is awake, at the size it has each second; replicas count the same way. An environment kept always on counts around the clock, at least at its minimum size; it is part of no plan and is charged as usage, apart from the plan's fee. Data is billed per GB-month. It comes out of the month's credit first.

Questions

Create a database

One command, one connection address.

Sign-up is by invite for now. If you have a code, create your account.

Sign up withEmail codeSMS code