Nexus Chat
A real-time chat backend that stays responsive when the database slows down.
Open source · my own project
The problem
Real-time chat has to stay responsive when write volume spikes or the database slows down.
What I did
- A queue separates receiving messages from saving them.
- Read receipts collect in Redis and save in 10-second batches.
- Video calls use WebRTC, with the socket server only connecting the two people.
The result
- About 99% fewer read-receipt writes.
- The socket layer never waits on the database.
How it's built
Socket.IO gateway → BullMQ → worker → range-partitioned Postgres. Receipts → Redis → batched flush.
Built with Node.js, Socket.IO, PostgreSQL, Redis, BullMQ, WebRTC.