Appearance
MongoDB & Redis
Sosyabot has two storage dependencies: MongoDB for the system of record and Redis for the BullMQ job queue.
MongoDB
- Version: 6.0 or newer (Mongoose 8 supports 6.0+; tested against 7.0).
- Connection:
MONGODB_URL=mongodb://user:pass@host:27017/sosyabot. - Auth: passwords containing URL-reserved characters must be URL-encoded.
- Replica set: optional but recommended for production. Append
?replicaSet=...&readPreference=primaryto the URL.
Collections
The largest collections by row count:
accounts— connected social channels.posts— every post ever drafted, scheduled, sent, or failed.post_stats— engagement snapshots (find-slot reads from this — see Best Posting Time).agent_runs— autonomous-agent execution history.usage_counters— AI credit accounting.audit_log— admin and security events.
Redis
- Version: 7.0+. BullMQ requires Redis Streams support.
- Connection:
REDIS_URL=redis://:pass@host:6379/0. - Persistence: not required — Sosyabot treats Redis as ephemeral state. BullMQ jobs replay on worker restart from MongoDB-backed scheduled-post records.
Queues
ai-video— async video-generation jobs (video).ai-agents— autonomous agent runs (agents).ai-generation— synchronous prompt / inline generation jobs.token-refresh— sweeps OAuth tokens (Threads, Pinterest, YouTube, Reddit) every interval; see Connections.post-publishing— scheduled-post fan-out worker.
WORKER_CONCURRENCY (default 4) controls how many jobs the worker handles concurrently per queue.
Sizing
Rough guidance for a single-tenant deployment:
| Tenants × posts/month | Mongo storage | Mongo RAM | Redis RAM |
|---|---|---|---|
| 10 × 1 000 | 1 GB | 1 GB | 256 MB |
| 100 × 5 000 | 20 GB | 4 GB | 1 GB |
| 1 000 × 10 000 | 200 GB | 16 GB | 4 GB |
Most growth is in post_stats — ~100 bytes per snapshot per post per platform. A 90-day window keeps the working set bounded.
Backups
See Backups. Mongo is the source of truth — back it up daily; Redis can be rebuilt from Mongo.