Deployment
Run Chimpbase across multiple containers with Docker Compose.
A single Chimpbase process runs everything — HTTP, workers, cron, and subscriptions. As your workload grows, you can split these responsibilities across multiple containers while sharing the same PostgreSQL database.
Single process (default)
The simplest deployment is a single container that does everything:
This single app container handles HTTP requests, processes background jobs, runs cron schedules, and delivers subscription events. For many workloads, this is enough.
Scaling workers
When background jobs need more throughput, add dedicated worker containers. Since queue coordination happens through PostgreSQL, multiple containers can safely poll the same queues:
All containers run the same chimpbase.app.ts. The worker replicas pick up jobs from the shared PostgreSQL queue — no broker needed.
Environment variables
| Variable | Default | Purpose |
|---|---|---|
DATABASE_URL | — | PostgreSQL connection string |
CHIMPBASE_SERVER_PORT | 3000 | HTTP server port |
CHIMPBASE_STORAGE_ENGINE | auto | postgres, sqlite, or memory |
CHIMPBASE_WORKER_CONCURRENCY | — | Max concurrent jobs per container |
CHIMPBASE_WORKER_POLL_INTERVAL_MS | — | How often workers poll for new jobs |
CHIMPBASE_WORKER_LEASE_MS | — | Job lease duration before retry |
Why this works
Chimpbase uses PostgreSQL for all coordination:
- Queues use row-level locking — multiple workers safely dequeue without duplicates
- Cron schedules are durable — only one container fires each scheduled slot
- Subscriptions with
idempotent: truededuplicate across processes - Workflows persist state in PostgreSQL — any container can resume a workflow
No separate broker, no leader election service, no external scheduler. PostgreSQL handles it.
Scaling further
When a single PostgreSQL instance becomes the bottleneck:
- Add read replicas for query-heavy actions
- Move high-throughput queues to a dedicated broker
- Shard workflows by tenant or domain
But start here. One database, N containers, and the same chimpbase.app.ts everywhere.