Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Member Polls
whats your favorite language

WebSockets vs polling for real-time web app

Last updated on 8 days ago
K
KevinSenior Member
Posted 8 days ago
User: WebSocket_Learner
Subject: WebSockets vs polling for real-time web app
Developing real-time dashboard that shows sensor data updates. Should I use WebSockets or just do polling every few seconds with AJAX? What are tradeoffs? WebSockets seem complicated to implement.
K
KevinSenior Member
Posted 8 days ago
Reply by: RealTimeWeb_Expert
WebSockets are definitely better for real-time applications. Polling wastes bandwidth because you're constantly making requests even when no new data. WebSockets maintain persistent connection and server pushes data when available. Yes initial setup is bit more complex but libraries like Socket.io make it very easy. For production real-time app, always choose WebSockets over polling.
K
KevinSenior Member
Posted 8 days ago
Reply by: FullStack_Pragmatist
Depends on your scale and update frequency. If updates are once every 30 seconds and you have only 10-20 clients, polling is simpler and works fine. If you need sub-second updates or have hundreds of concurrent users, then WebSockets are necessary. Also consider Server-Sent Events (SSE) as middle ground - simpler than WebSockets but more efficient than polling for one-way server to client communication.
Edited by Kevin on 26-11-2025 21:30, 8 days ago
You can view all discussion threads in this forum.
You cannot start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You cannot download attachments in this forum.
Sign In
Not a member yet? Click here to register.
Forgot Password?
Users Online Now
Guests Online 6
Members Online 0

Total Members: 19
Newest Member: bokovac