Skip to main content
Version: 0.9.14

Database service operations

The Database service provides centralized PostgreSQL and Redis for every other service. Postgres is the primary data store; Redis serves as cache, session store, pub/sub bus, and leader-election backend. Data lives on an attached block storage volume at /mnt/data.

Instance

Instance vCPU and RAM are in Provision instances.

FieldValue
NetworkPrivate only — no public IP
Block storageAttached volume at /mnt/data — typically 30 GB (staging) / 50 GB (production)
ScalableNo — single instance

Containers

ContainerImagePortPurpose
voiceai-postgrespostgres:17-alpine5432PostgreSQL primary
voiceai-pgbounceredoburu/pgbouncer:v1.25.1-p06432 (in-cluster)Connection pooler (TLS-aware)
voiceai-redisredis:7-alpine6379 plain · 6380 TLS (when enabled)Cache / pub-sub / leader-election
voiceai-otel-collectorotel/opentelemetry-collector-contrib:0.154.0Telemetry collector (also scrapes Postgres + Redis metrics)

PgBouncer fronts Postgres and brokers TLS for the SSL rollout (Leg 1 = app → pgbouncer, Leg 2 = pgbouncer → Postgres).

Data layout

/mnt/data/ # attached volume
├── postgres/ # PostgreSQL data
├── redis/ # Redis RDB
└── logs/postgresql/ # log files

Postgres consumers

Postgres is the durable source of truth for configuration and business data that must survive restarts, instance replacement, and Redis loss.

ConsumerAccessMain use
TelWebRead / writePlatform, team, user, app, flow, provider, notification-template, and admin configuration from the dashboard.
TelAPIRead / writeAPI-facing platform state, call tokens, channel/session metadata, and client-visible configuration.
TelPhiRead / writeConversation records, summarized call state, provider and flow configuration, recording metadata, and runtime health metadata.
TaskerRead / writeCron schedules, queued jobs, notification rendering, recording post-processing results, conversation diagnostics persistence, password-expiry checks, cleanup jobs, and DB backups.
ScalerRead / writeServer groups, desired capacity, scaling configuration, instance lifecycle state, and observed server metrics.

Configuration stored here includes ingress and egress SIP trunks, phone numbers, header rules, server groups, autoscaling policy, default provider settings, team variables and secret references, S3 bucket metadata for recordings, platform audio metadata, notification templates, cron schedules, user and team management, and app / flow / bot settings such as STT, TTS, LLM, action, and header-forwarding configuration.

Redis consumers

Redis is runtime coordination state, not the backup source of truth. Losing Redis may interrupt active calls or routing until services rebuild their state, but durable configuration should be restored from Postgres and the boot-time config sources.

ConsumerAccessMain use
TelPro / KamailioRead / writeSIP dialog state, dispatcher sets, Voice instance allowlists, registrations, egress trunk caches, and outbound header allowlist caches.
TelAPIRead / writeBrowser-to-ARI channel streams and short-lived API runtime state.
TelWebRead / writeDashboard and platform runtime caches; durable settings still live in Postgres.
TelPhiRead / writeVoice instance heartbeats, call health metrics, cached flow/provider data, and Redis streams used during live sessions.
ScalerRead / writeLeader election, health metric reads, scale decision state, and dispatcher / server-list updates for Voice routing.
TaskerRead / writeLeader election and the Redis/Postgres consistency check.

See also