Skip to content
GitHubRSS

Deployments

BigBrotr ships with two deployment configurations that demonstrate different use cases. Both use the same codebase and all six services.

deployments/
├── Dockerfile # Shared parametric Dockerfile
├── bigbrotr/ # Full deployment
│ ├── docker-compose.yaml
│ ├── .env.example
│ ├── config/
│ │ ├── brotr.yaml
│ │ └── services/*.yaml
│ ├── postgres/
│ │ └── init/*.sql # 10 SQL files, 25 stored functions
│ ├── pgbouncer/
│ │ └── pgbouncer.ini
│ └── monitoring/
│ ├── prometheus/
│ └── grafana/
└── lilbrotr/ # Lightweight deployment
├── docker-compose.yaml
├── .env.example
├── config/
├── postgres/
├── pgbouncer/
└── monitoring/

The full deployment for comprehensive Nostr network observation.

  • All six services with full configuration
  • All 11 materialized views
  • PostgreSQL with PgBouncer (transaction mode)
  • Prometheus metrics collection with 6 alert rules
  • Grafana dashboards with service overview
  • Docker Compose with resource limits and health checks
  • Two Docker networks: data (services + database) and monitoring
ServiceImagePurpose
postgresPostgreSQL 16Database with schema initialization
pgbouncerPgBouncerConnection pooling (transaction mode)
prometheusPrometheusMetrics collection and alerting
grafanaGrafanaMonitoring dashboards

Two connection pools:

PoolUsersPool SizePurpose
bigbrotrwriter10All six services
bigbrotr_readonlyreader8API, DVM, monitoring

A lightweight deployment with the same architecture, demonstrating BigBrotr’s customizability.

  • Same six services and all 11 materialized views
  • Smaller batch sizes and longer sleep intervals
  • Lower resource limits
  • Same monitoring stack

The key difference is configuration tuning, not code changes. LilBrotr processes less data per cycle but uses the same codebase.

Both deployments share a single Dockerfile:

ARG DEPLOYMENT
# ... builds for the specified deployment

Build with:

Terminal window
docker build --build-arg DEPLOYMENT=bigbrotr -t bigbrotr .
docker build --build-arg DEPLOYMENT=lilbrotr -t lilbrotr .

Both deployments use .env files for secrets and runtime configuration:

VariableDescription
POSTGRES_USERPostgreSQL superuser
POSTGRES_PASSWORDSuperuser password
POSTGRES_DBDatabase name
WRITER_USERWriter services user
WRITER_PASSWORDWriter password
READER_USERRead-only user
READER_PASSWORDReader password
NOSTR_PRIVATE_KEYMonitor event publishing key (optional)

To create a custom deployment:

  1. Copy an existing deployment directory.
  2. Modify config/brotr.yaml for your database settings.
  3. Adjust config/services/*.yaml for your batch sizes and intervals.
  4. Update .env.example with your database name and credentials.
  5. Modify pgbouncer/pgbouncer.ini with your pool names.
  6. Build with --build-arg DEPLOYMENT=yourdeployment.