Long Polling, Websockets, Server Sent Events - Who Wins? | Systems Design with Ex-Google SWE

  Рет қаралды 8,973

Jordan has no life

Jordan has no life

Күн бұрын

Пікірлер: 31
@matthewsaucedo2471
@matthewsaucedo2471 Жыл бұрын
Really enjoying this content; you break the content down in a really approachable way! I think the depth of info covered is pretty good too. Obviously not too detailed but enough to enable people to know what to search for if they decide they want to learn more.
@jordanhasnolife5163
@jordanhasnolife5163 Жыл бұрын
Yeah at the end of the day it's an interview channel, don't want to bombard everyone too hard haha
@ored5138
@ored5138 Жыл бұрын
Hi, watched a few videos of yours. Very nice job, helps me a lot!
@agent000000008
@agent000000008 Ай бұрын
Hey Jordan. A bit confused here about long polling (thanks for all the content btw): If we long poll, don’t we also hold an open (though not persistent) connection? And if we need to reestablish it anyways, isn’t it twice the load on server? Both has to hold open connection and also receive a new request for each new data event? Always thought that long polling was inefficient exactly for the reason of an open connection held on the server and that web sockets at least slightly decreased the load there
@jordanhasnolife5163
@jordanhasnolife5163 Ай бұрын
I don't really disagree with anything that you've said! That being said, polling can have the occasional nice property of basically rebalancing itself to another server via load balancing if one becomes overloaded
@user-sx4wm5ls5q
@user-sx4wm5ls5q 2 ай бұрын
I guess the websockets need to be sticky sessioned(a client being only connected to one of the horizontal scaled servers?), hence to keep it connected with the client & service...? If so, in case of failure and how do we know which data to send again from the server?(I guess this question goes same for the UDP, how does the Netflix know I watched this video until certain time when the server that respond gets killed? If we sacrifice the reliability, i guess we can just restart from some random(But recent) time?). PS. But again, thanks for the awesome video. Your my life savor and I mean it!(forgot to add this.)
@jordanhasnolife5163
@jordanhasnolife5163 2 ай бұрын
In your netflix example, we can never be perfect, but the server basically persists the last known timestamp until it dies.
@ankitasajwan931
@ankitasajwan931 Ай бұрын
Hey Jordan Thank you for this great content. The notes you create while recording videos. Is there any way possible, you can share them?
@jordanhasnolife5163
@jordanhasnolife5163 Ай бұрын
I already have, go to the substack link in my channel about page
@povdata
@povdata Жыл бұрын
Thank you! The SSE works like broadcast from server. So all clients gets the same data result. How to send data for specific clients, for exmaple who has subscription on category: "news". I write more in application layer.
@amartyaa
@amartyaa Жыл бұрын
This feels more like a 'pub/sub' kind of problem. I'll say the combination of pub sub and SSE will be a good idea here.
@tomaszzieba315
@tomaszzieba315 Жыл бұрын
For every client, you have a different "session" in SSE. So when a user is logged in and has the session opened you send an event to a user which. No session -> no event send
@jordanhasnolife5163
@jordanhasnolife5163 Жыл бұрын
Perhaps using different event sources
@povdata
@povdata Жыл бұрын
@@tomaszzieba315 seems SSE does not support session. could you help me?
@Nero21952
@Nero21952 9 ай бұрын
Great content Jordan, thank you for all your videos. I was curious - are stock trading platforms or websites that display live updates (say sports sites with live scores, etc) using SSEs?
@jordanhasnolife5163
@jordanhasnolife5163 9 ай бұрын
I would imagine that some percentage of them are, but hard to say without checking each codebase individually
@almirdavletov535
@almirdavletov535 8 ай бұрын
Or network tab 😄
@Gitsniks
@Gitsniks Жыл бұрын
should i watch the newer versions of your videos or both the old and new versions? like for this topic, is it fine just to watch this vid or the old one
@jordanhasnolife5163
@jordanhasnolife5163 Жыл бұрын
I think the newer ones are meant to be strictly better than the older ones. Ideally it's all of the same content, but just better for visual learners. Gonna do the same for the interview problems starting in a couple of weeks
@zhonglin5985
@zhonglin5985 8 ай бұрын
I noticed in the old vid you mentioned WebSockets were the ones having thundering herb problem due to reconnects, while in this new vid you are saying only SSE will have this problem. Should we say they both have this problem?
@jordanhasnolife5163
@jordanhasnolife5163 8 ай бұрын
Hmm interesting, maybe a typo on my end, it's just SSE that automatically reconnect by default, but if you naively reconnect a websocket right when it breaks I suppose you could have a thundering herd issue there too.
@mcee311
@mcee311 Жыл бұрын
How does server side event know which client to reestablish connection with? Do they maintain a list of clients?
@jordanhasnolife5163
@jordanhasnolife5163 Жыл бұрын
I believe this is handled by the client
@sahilguleria6976
@sahilguleria6976 4 ай бұрын
I believe client subscribes for the events, not exactly like PUB-SUB model, from chatGPT In Server-Sent Events (SSE), it's the client that initiates and establishes the connection to the server and then the server pushes updates through that established connection.
@TOc0olFORu
@TOc0olFORu Жыл бұрын
Hair looking fly today
@jordanhasnolife5163
@jordanhasnolife5163 Жыл бұрын
I'm asymptotically approaching SBF
@yrfvnihfcvhjikfjn
@yrfvnihfcvhjikfjn Жыл бұрын
LMAO at that intro
@spokesperson_usa
@spokesperson_usa Жыл бұрын
Web2 browser scripting isn't software engineering, it's script kid engineering.
@jordanhasnolife5163
@jordanhasnolife5163 Жыл бұрын
:O
Что-что Мурсдей говорит? 💭 #симбочка #симба #мурсдей
00:19
It works #beatbox #tiktok
00:34
BeatboxJCOP
Рет қаралды 41 МЛН
The genius of long polling
28:14
Hussein Nasser
Рет қаралды 17 М.
This is why you'll need polling in your web applications
11:36
Web Dev Cody
Рет қаралды 36 М.
Server-Sent Events Crash Course
29:48
Hussein Nasser
Рет қаралды 99 М.
Don't Use Websockets (Until You Try This…)
6:46
Code With Ryan
Рет қаралды 326 М.