Question Locked

How Do You Handle Real-Time Updates in Web Apps Without Slowing Performance

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I’m working on a web app that requires live updates (like new messages or order status changes). I’ve tried using WebSockets, but performance drops as the number of connections grows. What’s the best way to handle real-time updates efficiently Socket.io, server-sent events, or a different approach?

2 replies

by rproffitt edited

This is not just a software issue. You can only do so much on a single system. Example: SERVER FARMS.

It's that simple.

by KeWin555 edited

If your app is mostly pushing "here's what changed" to lots of viewers, WebSockets aren't the problem-it's where you fan-out and how often you push. I've had better luck treating the realtime layer as a thin gateway and pushing small, batched updates over a one-way channel when possible. For simple notifications, SSE (HTTP/2) is cheaper per connection and reconnects cleanly; keep WebSockets only for rooms that truly need upstream messages (chat input, cursors, acks). The big win is to stop broadcasting straight from app servers: publish events to a broker (Redis/NATS/Kafka), let your realtime nodes subscribe and fan-out, and send diffs instead of whole objects. On the client, buffer bursts and render on requestAnimationFrame so you're not reflowing the UI 50 times a second.

This discussion is closed to new replies.