Skip to main content

Architecture

Fluxer’s infrastructure is built on a modern, containerized stack designed for scalability, reliability, and operational excellence.

Core Infrastructure Components

Database

Cassandra 5.0 - Primary data store for messages, users, guilds, and relationships with automatic snapshots and encrypted backups

Caching & State

Valkey 8.0 - Redis-compatible in-memory store for sessions, rate limiting, and real-time state management

Message Queue

NATS JetStream - High-performance messaging for event distribution and service communication

Monitoring

SigNoz - OpenTelemetry-native observability platform for traces, metrics, and logs

Infrastructure Services

Data Layer

ServiceTechnologyPurpose
cassandraCassandra 5.0Primary database for persistent data
cassandra-backupCustom backup serviceAutomated encrypted backups to B2 object storage
valkeyValkey 8.0 AlpineIn-memory cache and session store
nats_jetstreamNATS 2 AlpineMessage queue with persistence
nats_coreNATS 2 AlpineCore messaging for real-time events

Observability Stack

ServiceTechnologyPurpose
signozSigNoz v0.108.0APM and observability platform
otel-collectorSigNoz OTel CollectorOpenTelemetry data collection
clickhouseClickHouse 25.5.6Time-series metrics storage
zookeeperZookeeper 3.7.1Coordination for ClickHouse

Media & Proxies

ServiceTechnologyPurpose
LiveKitLiveKit v1.9.11WebRTC SFU for voice/video
CaddyCaddy v2.10.2Reverse proxy with auto TLS
coturncoturnTURN/STUN for NAT traversal
nginxnginxStatic asset serving

Supporting Services

Antivirus engine for scanning uploaded files and attachments in real-time.
  • On-access scanning for media uploads
  • Daily signature updates
  • Quarantine and notification system
Collaborative translation platform for community-driven internationalization.
  • Web-based translation interface
  • Git integration for version control
  • Translation memory and terminology
Headless CMS for official blog and documentation.
  • SEO-optimized content delivery
  • Custom themes and layouts
  • Newsletter integration
Remote caching server for Turborepo monorepo builds.
  • Shared build cache across CI/CD
  • Significant build time reduction
  • S3-compatible storage backend

Deployment Model

Docker Swarm

Fluxer uses Docker Swarm for container orchestration, providing:
  • Service replication - Horizontal scaling with replica sets
  • Rolling updates - Zero-downtime deployments
  • Health checks - Automatic container restart on failure
  • Overlay networking - Secure inter-service communication
  • Secret management - Encrypted configuration and credentials
# Initialize swarm (if not already)
docker swarm init

# Create shared network
docker network create -d overlay fluxer-shared

# Deploy a service stack
cd fluxer_devops/cassandra
docker stack deploy -c compose.yaml fluxer-cassandra

Resource Allocation

Production Specifications

resources:
  limits:
    cpus: '6'
    memory: 64G
  reservations:
    cpus: '4'
    memory: 48G
  • Heap Size: 32GB (MAX_HEAP_SIZE)
  • Storage: Local SSD volumes for optimal I/O
  • Ulimits: 100k nofile for connection handling

Network Configuration

Port Allocations

Port(s)ServiceProtocolPurpose
9042CassandraTCPCQL native protocol
6379ValkeyTCPRedis protocol
4222-4223NATSTCPNATS client connections
8222NATSHTTPNATS monitoring
7880-7881LiveKitTCPWebRTC signaling
50000-60000LiveKitUDPWebRTC media
3478coturnUDPTURN/STUN
4317-4318OTelTCPOpenTelemetry ingestion
8080SigNozHTTPObservability UI

Overlay Network

All services communicate over the fluxer-shared overlay network:
docker network create \
  --driver overlay \
  --subnet 10.20.0.0/16 \
  --attachable \
  fluxer-shared

Configuration Management

Configuration is managed through:
  1. Environment files - /etc/fluxer/*.env for service-specific config
  2. Docker configs - Immutable configuration objects in Swarm
  3. Docker secrets - Encrypted credentials and API keys
  4. Volume mounts - Static configuration files
echo -n "super-secret-password" | \
  docker secret create cassandra_password -

Health Monitoring

All services include health checks for automatic recovery:
healthcheck:
  test: ['CMD-SHELL', 'nodetool status']
  interval: 30s
  timeout: 10s
  retries: 5
  start_period: 120s

Next Steps

livekitctl

Bootstrap LiveKit infrastructure for voice and video

Cassandra

Configure and manage the Cassandra database cluster

Monitoring

Set up observability with SigNoz and OpenTelemetry

Backup & Restore

Implement backup strategies and disaster recovery

Build docs developers (and LLMs) love