Database limits

Database size, connection and query limits per plan, and what happens when a database is full.

LimitFreeProScaleEnterprise
Database size500 MB10 GB20 GB20 GB
Direct database connections20100160300
Pooled client connections1,00010,00015,00020,000
Pooler database connections5203040
API query timeout8 s30 s60 s60 s
Read replicas per project (paid add-on, up to)0112
Backup retentionNo backups7 days14 days30 days
Point-in-time recovery1 days7 days14 days30 days

The database size limit applies to each project on every plan (with the spend cap off, a project may go over and the extra GB-months are billed; see Spend cap and usage pricing). The API query timeout applies to REST requests; the SQL Editor allows up to 60 seconds.

#When the database is full

StitchDB checks database sizes every few minutes and e-mails you when a project reaches 80% and again when it goes over 100%. Over the limit the database becomes read-only, and nothing is deleted:

  • REST API requests that write (including deletes) fail with This project is over its database size limit and is read-only (error code 25006).
  • New transactions on database connections are read-only by default.
  • Reads keep working.

To free up space, run the setting together with your deletes in the SQL Editor (or in a session-mode connection):

SQL
set default_transaction_read_only = off;
delete from public.events where created_at < now() - interval '90 days';
vacuum public.events;

truncate and drop table free space right away; space from deleted rows is reused after vacuum. Writes resume within a few minutes once the database is below the limit or your plan allows more.