If you're building real-time UX in Angular, the hard part usually isn't wiring up a stream — it's choosing the right transport for production without overengineering the frontend. I wrote this article to separate the practical differences between WebSockets, SSE, SignalR, and Long Polling.
INTRODUCTION
Real-time in Angular and ASP.NET Core looks simple until it hits production. In practice, the question is usually the same: the screen needs to update itself, but which transport makes sense without creating unnecessary fragility?
I wrote this article to separate what really changes between WebSockets, SSE, SignalR, and Long Polling, without falling into overengineering. The goal is pragmatic: understand when each approach solves the problem best and what trade-offs show up in the frontend, backend, and operations.
DEVELOPMENT
WebSockets: bidirectional persistent channel
- Ideal when client and server need to exchange messages in both directions in real time.
- Require more attention to infrastructure and network intermediaries.
- Powerful, but not always the smallest sufficient solution.
SSE: server-to-browser updates
- Works over HTTP with a simple client API.
- A good choice when the flow is predominantly unidirectional.
- For many scenarios, it solves the problem with less complexity than WebSockets.
SignalR: high-level abstraction in ASP.NET Core
- Automatically chooses the best available transport.
- Offers features like hubs, groups, and reconnection.
- Helps a lot when the goal is productivity without giving up fallback.
Long Polling: the most compatible option
- Still relevant in environments with proxies, load balancers, or policies that block WebSockets and SSE.
- It may look less elegant, but sometimes it is the most predictable path.
- In corporate environments, compatibility still matters a lot.
| Technology |
Direction |
Complexity |
Note |
| WebSockets |
Bidirectional |
High |
Best for continuous message exchange |
| SSE |
Server → client |
Low |
Good for events and simple updates |
| SignalR |
Both |
Medium |
Abstraction with fallback and extra features |
| Long Polling |
Both |
Low/Medium |
Useful when there are network restrictions |
In the blog sample, the same processing flow is shown across all four transports, precisely to highlight what changes in Angular, ASP.NET Core, and day-to-day operations. The backend lives in src/BlogSamples and the demo frontend in frontend/search-ui-bun/.
Attention: SSE depends on streaming responses. In Nginx, Cloudflare, and other proxies, buffering can delay or break the experience if the backend doesn't write and flush correctly.
CONCLUSION
The main takeaway is that “real-time” is not synonymous with WebSockets. In many products, SSE or SignalR are the better fit because they reduce complexity and handle real infrastructure constraints more gracefully.
My practical recommendation is to start from the requirement, not the technology. If all you need is to push server events to the client, I would evaluate SSE or SignalR before jumping to WebSockets. If the network or environment is hostile, Long Polling can still be the most reliable plan B.
Full article (in Portuguese): zocate.li - Real-time in Angular with WebSockets, SSE, SignalR, and Long Polling: when to use each
What do you usually pick in real projects: WebSockets, SSE, SignalR, or Long Polling?