Skip to content

[Backend] Add read replicas and PgBouncer pooling - #1558

Open
Marvellous805 wants to merge 5 commits into
LabsCrypt:mainfrom
Marvellous805:fix/1325-read-replicas-pgbouncer
Open

Marvellous805 wants to merge 5 commits into
LabsCrypt:mainfrom
Marvellous805:fix/1325-read-replicas-pgbouncer

Conversation

@Marvellous805

Copy link
Copy Markdown

Closes #1325

Changes

  • Configure Prisma read replicas from DATABASE_READ_REPLICA_URL; writes and transactions remain on the primary.
  • Route stream listing, stream events, event history, and summary reads through replica-aware fallback with a short outage cooldown.
  • Set pool defaults to 20 connections, 10-second idle timeout, and 2-second connection timeout.
  • Add a PgBouncer transaction-pooling sidecar to Docker Compose, capped at 20 PostgreSQL connections.

Validation

  • git diff --check
  • Parsed backend/package.json and package-lock.json as JSON.
  • Test suite and 1,000-request load test were not run in this environment.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Backend] Database Read Replicas & Connection Pooling Optimization with PgBouncer

1 participant