A Smart Way to Create Scalable Web Sockets in NestJS

A long time ago, I found myself in a situation where I had to create a scalable system that could be capable of handling hundreds of simultaneous connections at not very high cost, and with reasonable, but not instant time of response. My first thoughts? Let’s move all create/edit/delete actions to the queue and notify users if their actions succeeded or not via WebSocket. But back then, I hadn’t much experience with WebSockets in production, so my first step was to investigate how it works with the help of tutorials, stack overflow, and other sources. ...

October 28, 2023 · 8 min