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
| Service | Technology | Purpose |
|---|---|---|
| cassandra | Cassandra 5.0 | Primary database for persistent data |
| cassandra-backup | Custom backup service | Automated encrypted backups to B2 object storage |
| valkey | Valkey 8.0 Alpine | In-memory cache and session store |
| nats_jetstream | NATS 2 Alpine | Message queue with persistence |
| nats_core | NATS 2 Alpine | Core messaging for real-time events |
Observability Stack
| Service | Technology | Purpose |
|---|---|---|
| signoz | SigNoz v0.108.0 | APM and observability platform |
| otel-collector | SigNoz OTel Collector | OpenTelemetry data collection |
| clickhouse | ClickHouse 25.5.6 | Time-series metrics storage |
| zookeeper | Zookeeper 3.7.1 | Coordination for ClickHouse |
Media & Proxies
| Service | Technology | Purpose |
|---|---|---|
| LiveKit | LiveKit v1.9.11 | WebRTC SFU for voice/video |
| Caddy | Caddy v2.10.2 | Reverse proxy with auto TLS |
| coturn | coturn | TURN/STUN for NAT traversal |
| nginx | nginx | Static asset serving |
Supporting Services
ClamAV - Malware Scanning
ClamAV - Malware Scanning
Antivirus engine for scanning uploaded files and attachments in real-time.
- On-access scanning for media uploads
- Daily signature updates
- Quarantine and notification system
Weblate - Localization
Weblate - Localization
Collaborative translation platform for community-driven internationalization.
- Web-based translation interface
- Git integration for version control
- Translation memory and terminology
Ghost Blog - Marketing
Ghost Blog - Marketing
Headless CMS for official blog and documentation.
- SEO-optimized content delivery
- Custom themes and layouts
- Newsletter integration
Turborepo Cache - Build Optimization
Turborepo Cache - Build Optimization
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
Resource Allocation
Production Specifications
- Cassandra
- Valkey
- OTel Collector
- 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) | Service | Protocol | Purpose |
|---|---|---|---|
| 9042 | Cassandra | TCP | CQL native protocol |
| 6379 | Valkey | TCP | Redis protocol |
| 4222-4223 | NATS | TCP | NATS client connections |
| 8222 | NATS | HTTP | NATS monitoring |
| 7880-7881 | LiveKit | TCP | WebRTC signaling |
| 50000-60000 | LiveKit | UDP | WebRTC media |
| 3478 | coturn | UDP | TURN/STUN |
| 4317-4318 | OTel | TCP | OpenTelemetry ingestion |
| 8080 | SigNoz | HTTP | Observability UI |
Overlay Network
All services communicate over thefluxer-shared overlay network:
Configuration Management
Configuration is managed through:- Environment files -
/etc/fluxer/*.envfor service-specific config - Docker configs - Immutable configuration objects in Swarm
- Docker secrets - Encrypted credentials and API keys
- Volume mounts - Static configuration files
Health Monitoring
All services include health checks for automatic recovery: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