200+ positive starstarstarstarstar ratings from our clients

Real-time features: websockets vs server-sent events vs polling

Nov 30, 2026

Two colleagues walking through the office mid-conversation, talking through how live the data must be

Nov 30, 2026


Websockets vs server-sent events vs polling: most apps need less than you think

The websockets vs server-sent events question usually gets asked one step too late, because the real question is how old a number on screen is allowed to be before someone makes a wrong decision. answer that first and the technique mostly picks itself, and quite often it is plain polling. studio ubique is a web design and SEO agency from Zwolle, active since 2012, building custom websites, webshops and applications for dutch smes and international clients. this piece is for product owners and developers about to add live updates to a real-time web application, who want the cheapest option that still tells the truth.

Real-time is a promise about how stale a number may be, not a choice of protocol, and most teams never write that number down.

Websockets vs server-sent events vs polling, in plain terms

There are three ways to get fresh data into a browser, and they differ in who starts the conversation and whether it stays open. Polling means the browser asks the server for news every few seconds, like checking the letterbox. Server-sent events (SSE) means the browser opens one ordinary HTTP request and the server keeps sending text messages down it, one way only. A websocket is one long-lived connection where both sides can talk whenever they like.

There is also long polling, the old long polling alternative to all of this: the browser asks, and the server holds the request open until it has something to say. It works, but it is mostly what people used before SSE and websockets were everywhere. The browser side of SSE is a built-in object called EventSource, and the MDN documentation on server-sent events is the clearest description of how it reconnects by itself.

Studio Ubique builds custom websites in WordPress, Vue.js, Node.js, Next.js, NestJS and Laravel. All three techniques run fine on all of those. The stack is rarely the deciding factor, which annoys people who wanted it to be.

How stale may the number be?

Picture a warehouse screen showing open orders. If it updates every 20 seconds, does anyone pick the wrong box? Almost never. Now picture a support chat where the customer types and waits. Twenty seconds there feels broken.

That gap is the whole decision. Before anyone opens an editor, write down three things:

  • The maximum age a value may have before it causes a wrong action, in seconds.
  • Which direction the data flows: only server to browser, or also browser to server, several times a second.
  • How many people have the screen open at the same time on a normal Tuesday.

Studio Ubique works from Zwolle since 2012. In that time the first answer on this list has usually been “a minute is fine”, said slightly sheepishly.

Decision box
  • Best if: users send and receive several messages per second, as in chat, shared editing or live cursors.
  • Not ideal if: data only flows from server to browser and changes once every few seconds or slower.
  • Likely overkill when: fewer than about 50 people use the screen at once and a 15 second delay harms nobody.
Two colleagues talking at the end of a long table, working out which way the data flows

When polling is the honest answer

Polling every 15 to 30 seconds is the right choice for most business screens: order overviews, stock levels, report status, admin panels. It uses normal requests, so caching, logging, authentication and your existing hosting all work without a second thought. When it fails, the next request simply tries again.

Here is the part not everyone will like. Most real-time requests in business software are vanity, and the people who call polling amateurish rarely pay the hosting bill or the support hours. Studio Ubique rates are 60 to 65 euro per hour. Every extra moving part is billed at that rate, forever, in debugging time nobody planned for.

The line sits roughly here. If the acceptable age is above 10 seconds and the data flows one way, poll. Keep it simple. Add a small trick such as asking “anything changed since timestamp X?” so most responses are nearly empty, and you have covered a surprising share of server-sent events vs polling debates without either side winning.

Where server-sent events earn their place

An export runs for four minutes and the user stares at a progress bar. Notifications arrive in bursts. A price ticks while someone fills in a quote. These are SSE jobs: the server has news, the browser only listens, and polling would mean hammering the server for answers that are mostly “not yet”.

SSE is underrated because it is boring. It is plain HTTP, so proxies and firewalls tend to leave it alone, and the browser reconnects on its own and can tell the server which message it saw last. One real limit: over HTTP/1.1, browsers allow about six open connections per domain, so a user with several tabs open can starve their own page. HTTP/2, the newer version of the protocol most modern hosting already speaks, removes that problem by sharing one connection.

When websockets are worth the extra moving parts

Websockets earn their keep when the browser talks back often: chat, collaborative editing, multiplayer anything, live cursors. Then a two-way connection is cleaner than SSE plus a stream of separate requests. In the SSE vs websockets comparison, that two-way traffic is the only argument that really counts.

The cost is that a websocket is a connection you now own. On an order tracking screen Studio Ubique built for a wholesaler, websockets were chosen because they felt like the grown-up option. Testing went fine. In production, the proxy in front of the app (the server that passes traffic through to the application) cut idle connections after 60 seconds. Nothing threw an error. The numbers simply froze, and the client’s first report was that the screen looked fine but was wrong, which is the worst kind of bug report because it is accurate. A heartbeat, a tiny message sent every 30 seconds to keep the line alive, fixed it in an afternoon. The more expensive lesson was that polling every 20 seconds would have done the job from day one, and we had argued against it.

If the real-time part is one piece of a larger web application development project, decide it alongside the data model, not as a late extra. The same goes for custom software development where several systems feed one screen: the technique matters less than knowing which system is the source of truth.

Two colleagues in a glass doorway weighing up push against polling for a live screen

Running real-time in production: proxies, deploys and reconnects

The protocol is the easy part; what breaks real-time features is everything between the server and the browser. Proxies close idle connections. Load balancers send a reconnect to a different server that has never heard of this user, unless you configure sticky sessions or share state through something like Redis. Every new release drops every open connection at once.

That last one deserves its own sentence. After a deploy, every browser reconnects in the same second, the server takes a spike it never sees during the day, and if the reconnect logic has no random delay built in, they all retry together again. Reconnect with backoff and a bit of randomness. Always.

This is also where hosting choice shows. On shared hosting you often cannot change proxy timeouts at all, which quietly rules out websockets. With managed VPS hosting you control the proxy settings, the timeouts and the process manager, so long-lived connections are a configuration question instead of a support ticket.

What to monitor monthly
  • Number of open connections at peak, compared with last month.
  • Reconnects per user per hour, since a rising count usually means a timeout somewhere.
  • Server memory right after each release.
  • Age of the newest value on screen, checked by hand on a busy day.
Two colleagues at a window desk going over a printed sheet after a release

Choosing between websockets, server-sent events and polling starts with one number: how many seconds old a value may be before someone acts on it wrongly. Above roughly 10 seconds with one-way data, polling is usually enough. SSE suits one-way streams, websockets suit frequent two-way traffic. Studio Ubique, which works from Zwolle since 2012, has seen proxy timeouts silently freeze websocket screens in production.


FAQs

Is SSE better than websockets?

Not better, narrower: SSE only sends from server to browser, which makes it simpler to run and friendlier to proxies, so it wins whenever the browser does not need to talk back often.

Is polling bad for performance?

Polling every 15 to 30 seconds with small “anything changed?” responses is light for most business apps, and it only gets heavy with very short intervals or thousands of users at once.

Do websockets work on shared hosting?

Often not reliably, because you cannot change proxy timeouts or keep long-running processes alive, so websockets usually need a VPS or a dedicated service.

What is a good long polling alternative?

For one-way updates, server-sent events do the same job with less code and built-in reconnecting, and for two-way traffic a websocket replaces it.

How do i know if my real-time data web app is actually live?

Open the screen on a busy day, change a value elsewhere and time how long it takes to appear, because monitoring will tell you a connection is open long after the data stopped moving.


The frozen number problem

Every week a real-time screen runs on the wrong technique is another week of numbers that look fine and quietly are not. Fixing the choice before launch costs an afternoon, fixing it after costs a migration.

Write down your staleness limit

Book a first call:

Book a first call

Contact

Not everyone likes to write. Rather talk to someone first? Book a 30 to 45 minute intro call through Calendly. It's free, and by the end you'll know whether a proposal makes sense.

Book a first call(opens in a new tab)

Tell us what's going on

Tell us what's stuck, what you want to build, or what needs fixing. You talk to someone from sales and someone technical, and we reply within one working day. First a conversation, then a plan, only then a price.

    Agency with a client who needs something? You’re in the right place. Want to sell us leads, SEO or developers? Kind of you, but we already do that ourselves.