Short Polling vs Long Polling vs WebSockets - System Design

preview_player
Показать описание
Learn the difference between short polling, long polling, and web sockets.

🎉 SUPPORT BE A BETTER DEV 🎉

📚 MY RECOMMENDED READING LIST FOR SOFTWARE DEVELOPERS📚

🎙 MY RECORDING EQUIPMENT 🎙

💻 MY DESKTOP EQUIPMENT 💻

🌎 Find me here:

#SoftwareEngineer
#SystemDesign
#Polling
Рекомендации по теме
Комментарии
Автор

An advantage for short polling is that the server can remain stateless.

Both long polling and web sockets needs to keep a directory of which server contains the connection to the client, which is used to send data to the client whenever it's ready

VasQuezadilla
Автор

A perfect video for understanding concepts.

ShivamBhaskarNITW
Автор

great explanation keep up the good work!!

amrmoneer
Автор

short and concise, I love this. It makes it clear on suitable implementation based on use cases.

neutronstar
Автор

Clear and precise explanation... Thank you!

tomstravelingadventures
Автор

Thank you. Your presentation is clear and helpful 😄

myrickchow
Автор

I liked the video as soon as you gave the example with Node.js backend. Props to you ;)

gttmone
Автор

great explanation, your videos are very helpful. Thank you Sir.

sakirbey
Автор

Right on the point! Thank you for sharing :)

mdsadiqurrahman
Автор

Great summary. My analogy for a web socket is a Telnet session.

glennadams
Автор

Finally someone with an accent I can understand!

jesusdueas
Автор

short polling can have benefits. ie if you want to check if a client is online and the client can ping the rest api every 5 mins to check if it is online. While it pings and gets a response, you can put other useful data in that response.

ninjaninja
Автор

This was great, thank you. Came here to figure out why OpenAI is using short polling with the assistants api lol

jaysonp
Автор

I made one project controlling switches on frontend(react js) and backend server(node js) . multiple users can control switch and all other users should also get get updated status of switch .what should i use in this case polling or web socket or server side event . i used api to post and save data and other client get update the status every 5 seconds from server it works for some time and then i get error .hope you understand and give me a solution

hemanthvijay
Автор

Thanks for sharing .. Does the timeout has to be handled by client app or server ?

cbest
Автор

Webhooks is another possible model that may be good, depending on your requirements.

edwardwong
Автор

In case of long polling, what happens in client side while they are waiting for the message or timeout? Do they still work on different task(Async)? Or do they wait until they get the response from the server(Sync)?

hanjang
Автор

I think a nice complimentary video would involve web hooks or some sort of asynchronous callback. Thanks a lot. Also why is short polling bad? At most it makes one connection to the resource just like the other methods. Is it the overhead of setting up connection?

adamhughes
Автор

What's a perfect use case for long polling?

Any use case?

Thanks

chihabahmed
Автор

Is a webhook called long polling? Great explanation.

jannickbreunis