track 03 · System design
Video backplane: realtime across stateless replicas
A live-streaming MVP built to exercise WebSockets at scale: Socket.IO with a Redis adapter fans chat out across stateless API replicas, with an RTMP to HLS video pipeline beside it.
PrototypeFastifySocket.IORedis pub/subPrismaFFmpegFastAPI
The question
Horizontal scaling breaks naive WebSocket servers: a message sent to one instance never reaches clients connected to another. The prototype targets that failure mode directly.
What it does
- Stateless Fastify and Socket.IO API replicas sharing chat state through a Redis pub/sub backplane, behind nginx.
- A thin video pipeline: nginx-rtmp ingest, FFmpeg transcoding to HLS, played with hls.js.
- A Python FastAPI moderation service called from the chat service; Postgres via Prisma; React, Vite and Tailwind frontend; docker-compose for local infrastructure.
Caveat. Built as an interview-preparation MVP. The target demo is to run two API instances and kill one mid-conversation without breaking the chat; treat it as a prototype, not a production system.