learn

Database and Redis

Neon Postgres, Upstash Redis, then run the migrations.

Postgres is the durable authority and Redis the live one, so give each a managed home: a Neon Postgres database and an Upstash Redis database, both reachable over their TCP connection strings. Do not use Render's free Key Value for rooms — it keeps state in memory only and loses everything on restart.

Create the Neon database and copy its connection string.

It becomes DATABASE_URL for every backend service. The database client throws without it.

Create the Upstash Redis database and copy its connection string.

It becomes REDIS_URL for every backend service. Use the TCP URL, not an HTTP one.

Run the migrations from packages/db.

Run db:emit, then db:migration-check, then db:migrate for a fresh database. For an existing database, verify migration and schema state first instead of resetting it.

Last verified: 2026-10-11. Free-tier limits change — check the providers before relying on any number.

Provider docs

What it owns

  • Durable scene revisions on Neon Postgres
  • Live room state on Upstash Redis over TCP
  • Schema migrations through the db package scripts

Talks to

Sources: packages/db/README.md, packages/db/src/prisma/README.md, packages/db/package.json, packages/db/.env.example, packages/db/src/prisma/db.ts (documented at commit b0026d9)

On this page