Run a self-hosted Requestarium on several replicas

A single backend container is fine for a team of 50. When the API client becomes something hundreds of engineers and every CI pipeline depend on, a node drain or a rolling upgrade shouldn't take it down. The Helm chart runs the Requestarium backend as several replicas behind one load balancer, on one Postgres.

Turn it on

values.yaml
backend:
  replicaCount: 2
  # or scale on CPU (needs metrics-server):
  # autoscaling: {enabled: true, minReplicas: 2, maxReplicas: 6, targetCPUUtilizationPercentage: 70}

With more than one replica the chart also adds a PodDisruptionBudget with minAvailable: 1, so a node drain never takes every replica down at once, and spreads replicas across nodes, so losing a node leaves the others serving.

The Docker Compose bundle stays on one replica. High availability is a Kubernetes setup.

What makes it work

ConcernHow it's handled
Sessionsstateless access tokens; any replica validates any token
Live updates between teammatesPostgres LISTEN/NOTIFY; every replica relays changes to its own clients
Who's editing whata shared table, not memory
Sign-in limits and other rate limitsshared counters in Postgres or Redis, so two replicas don't allow twice the limit
Background jobs: scheduled checks, purges, licence snapshots, directory syncone replica, elected with a Postgres advisory lock
Signing a session outthe replica that does it tells the others over a message bus

The requestarium_scheduler_leader metric is 1 on the replica currently running background jobs. If it goes away, another takes over.

Postgres connections

Each replica keeps a pool of up to 20 connections plus two of its own (the message bus and the leader lock). Plan max_connections for 22 per replica, plus backups and your own tools. Four replicas need about 90; the CloudNativePG default is 100.

Optional: Redis

By default the message bus and the shared rate limits use Postgres, so there's nothing extra to run. To move that traffic off the database, point the backend at Redis:

Output
TAIRI_REDIS_URL=redis://:[email protected]:6379/0

Use rediss:// for TLS. The backend checks the connection at start and refuses to start on a bad URL, so a typo can't silently split the replicas. Redis holds nothing that must survive a restart; leader election always uses Postgres.

Rolling upgrades

Rolling upgrades work because each replica drains: on shutdown it keeps serving for a few seconds while /ready already fails, so the load balancer stops sending it traffic before it closes. A pre-upgrade hook checks that the new version's migrations can run before any pod is replaced.