Skip to main content

Agent workloads outgrow Postgres.

Rivet is built for durable, multiplayer agent workloads, with high write throughput and large amounts of data.

Choose Rivet for

  • Yes: Durable agents
  • Yes: Multiplayer agents
  • Yes: Thousands of concurrent agents
  • Yes: Agent transcripts and filesystems
  • Yes: Per-tenant databases

Choose Postgres for

  • Yes: Users, billing and permissions
  • Yes: Queries across your whole app
  • Yes: Light, occasional writes

Use both if

  • Yes: You have an app and agents
  • Yes: App data stays in Postgres
  • Yes: Agent data moves to Rivet

Every Rivet database is ACID-compliant SQL, so Rivet can replace Postgres entirely too.

Add durable agents next to your Postgres app

Paste the prompt into your coding agent, or follow the AI agent guide.

Read the AI agent guide

Why Postgres struggles with agent data

Agents write orders of magnitude more data than apps: each concurrent agent keeps about 4 GB a month.1

  • No: Old data stays on expensive SSDs2Bill grows $944 every month for 1K concurrent agentsYes: Tiered: hot data on SSD, cold on S3~10x cheaper for cold data
  • No: One server takes every write3Tops out around 24K concurrent agentsYes: Add nodes to scale horizontallyScales without limit

Six months of storage for 1K concurrent agents12

Postgres

$19,822

Rivet

$1,982

Total spent on storage over 6 months.

$0$3K$6KToday3 months6 months$5,664/mo$566/mo

Why Postgres struggles with running and scaling agents

Agents need to be durable and multiplayer: they run for hours, take messages mid-run and stream to many viewers.

  • No: Two requests can hit one agent at onceWithout locks, races corrupt its stateYes: One Actor owns each agent’s stateWrites can’t collide
  • No: Every user in one shared databaseWithout row-level security, one missing WHERE leaks dataYes: Hard isolation, a database per agentNo query can reach another agent
  • No: LISTEN/NOTIFY doesn’t scale for multiplayer agents8 KB messages, and notifying commits run one at a timeYes: Realtime and multiplayer built inEvery viewer sees the agent live
  • No: A crash mid-run loses the agent’s progressYou build checkpoints and retriesYes: Agents survive crashesThey pick up where they left off
  • No: Each viewer on LISTEN holds a connection45,000 by default, so multiplayer needs a separate serviceYes: Multiplayer scales out horizontallyViewers connect to the agent

Rivet vs Postgres for agent workloads

FeaturePostgresRivet
DiskPartly: Resized as it fills2Never shrinks, 64 TiB maxYes: BottomlessNothing to resize
ScalingPartly: Bigger instanceVertical resize, with a failoverYes: Add nodesHorizontal, with any autoscaler
Reads and writesYes: SSD speedOver the networkYes: SSD speed for hot dataCold data on S3
SQLYes: One shared databaseYes: Full SQL per agentSQLite: joins, indexes, transactions
IsolationPartly: Shared databaseIsolated by your WHERE clausesYes: Database per agentIsolated by structure
MultiplayerNo: LISTEN/NOTIFYOr add WebSockets and pub/subYes: Built inEvents to every client
Durable agentsNo: Build it or add a libraryWorkers, queues and retriesYes: Built inSurvives crashes, sleeps when idle
ACID transactionsSame on bothEvery write is atomic and durable
ORMsSame on bothDrizzle, or plain SQL
Open sourceSame on bothApache 2.0 and the PostgreSQL License
Managed cloudSame on bothRivet Cloud, or RDS, Neon, Supabase and others
Bring your own cloudSame on bothRuns in your VPC, managed for you
Self-hostingSame on bothYour cloud, on-prem or air-gapped

How we estimated

Measured on a real agent, then scaled to 1,000 concurrent agents. Postgres is Amazon RDS for PostgreSQL in us-east-1, Multi-AZ with one standby, at list prices.

  1. 1An active agent

    We ran a real Pi Durable coding agent in a Rivet Actor: 15 sessions across five coding tasks, 28 minutes of non-stop work, with 267 model calls and 231 tool calls.

    While working it wrote about 6 rows a second at about 480 bytes each, in about 2 transactions a second: about 11 MB an hour. About 5.7 MB an hour stays in its database, 75 to 80% of it the transcript. Idle, it writes nothing.

    A concurrent agent is one agent working all the time: 5.7 MB × 24 hours × 30 days ≈ 4.1 GB kept a month. 1,000 concurrent agents keep about 4.1 TB a month.

  2. 2Storage cost

    RDS: gp3 storage on Multi-AZ costs $0.23 per GB-month, and allocated storage can’t shrink. Each month 1,000 concurrent agents add 4,104 GB × $0.23 ≈ $944 to the bill, for good.

    After six months that’s 24.6 TB, or $5,664 a month. One instance holds 64 TiB at most, so past about 17 months you also split across instances.

    The chart compares RDS storage with S3 for data Rivet has moved there; recent data stays on replicated SSD. S3 Standard is $0.023 per GB-month for the first 50 TB (51,200 GB), so six months in it’s 24,624 GB × $0.023 ≈ $566 a month.

    Over six months: RDS adds up to $944 × (1 + 2 + … + 6) ≈ $19,822. S3 adds up to $94 × 21 ≈ $1,982.

  3. 3Write throughput

    DBOS measured 144,000 single-row writes a second on one RDS db.m7i.24xlarge (96 vCPUs, 120,000 provisioned IOPS), limited by Postgres’s single write-ahead log.

    144,000 ÷ 6 row writes a second per active agent (measured above) ≈ 24,000 concurrent agents. That’s the best case: tiny single-row transactions on the largest instance. Bigger rows and smaller instances lower it.

  4. 4Connections

    RDS for PostgreSQL sets max_connections to LEAST(instance memory ÷ 9.5 MB, 5,000): about 400 on a 4 GiB instance, and 5,000 at most by default. A custom parameter group can raise it, which AWS advises against.

    Each connection is its own server process. A viewer that LISTENs on Postgres for an agent’s updates keeps one open.

    PgBouncer’s transaction pooling shares connections, but doesn’t support LISTEN or session-level advisory locks.

Sources, read November 14, 2026

Keep Postgres for your app. Put your agents on Rivet.

Durable, multiplayer agents, each with its own SQLite database on S3.

Read the AI agent guideTalk to an engineer