SSE vs WebSockets vs Long Polling. Martin Chaov. JS Fest 2018

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi guys I was informed I can I can start so I'm starting today I'm going to talk about different ways to deliver information from the server to the client but before that I would like to get to know your bit more so I'll be asking the general questions like what are you guys doing and you're going to raise hand if you're thinking okay and I promise I have t-shirts to give if people are complying with this so okay how many of you are doing just drip on the back end me too actually on the front end Oh full stock like okay and how many of you has been using wrong polling for example okay and push like WebSockets so most of you are doing actually WebSocket applications Wow okay so first few things about me I'm Martin I am currently an ongoing the second chest I'm working as a software architect SB tech and I generally have background in computer science and in sport battle and I used to be a graphic designer and it's hard for me to be smart and I want people to know it so if I make mistakes just correct me today I'm going to cover a few topics and I'm going to try to make technical demo if I don't receive blue screen of death so I will start with actually a business case because we need to know what we're implementing in order to understand the decisions that we're making then I'm going to cover the different possible implementations of this business case and I would do a demo now hurry and that was made them very interesting case about performance and paradigms today yesterday and you need to understand that everything that I'm going to show you today is because we won't want to make our application faster and more accessible so it we're not just doing it because there is something new to try out so what is the business case imagine we have mobile application any mobile application as a business we need to be fast we need to react fast and ever-changing market which means we want to release as well as less software we want to release as much software as possible as fast meaning that we are releasing less instead of releasing huge drugs in order to do that since we are delivering delivering huge amounts of data from the back end we need to somehow streamline this process now imagine that my application my beautiful application here has few different let's call them widgets those widgets every single one of them connects to some resource and gets data and updating kinda real-time so if I'm using technology which makes three connections for those three widgets that's not really ok so we are trying to make something like that we want every widget or entity on our page to make requests to our network and get multiplex response do you know what is multiplexing how many of you okay so multiplexing is a very nice concept imagine you have like a pipe and you can transfer only one resource at a time in this pipe this is generally how a connection works you request a resource you open a pipe the resource comes to you but with multiplexing you take a big axe and you chop the resource if you buy a few pieces and you start putting first resource second dose of tartar sauce on the same pipe and you send small packets of the same resource over the same pipe meaning that in this way we are going to get only one HTTP connection and all the our data is going to stream through this connection so we will not waste resources in vain now one of the reasons this is important is because on general when you are establishing connections you waste time and battery and we were still talking about mobile devices so we need to minimize the resources we are spending in order to optimize our performance one of the ways to do multiplexing conte web is using HTTP - do you know what's the main difference between HTTP 2 and HTTP 1 multiplexing there are other differences as well but in our interest multiplexing is the most important one so there are many ways to achieve taking data from the server to the client and we don't know which one is the best one right how many of you think that they know which is the best one ok good because nobody does ok so what we have we have three main options we can do variation of poling either one polling or short polling doesn't matter its polling we can use sockets or we can use server sent events so how do we know what we do what what we want to do well just do the moment and see what's the difference so without further ado let's start with one polling now one polling is the equivalent of the child on the backseat that's asking are we there yet are we there yet are we there yet so you just different things to make it ask the question less for example tell him count the corners we are going to be there in 50 corners and after 50 corners the child asks again are we there yet and so on so eventually this concept is it works but when you want to transmit a lot of data in small amount of time eventually you start wasting date and what I'm going to cover is I'm going to cover the main the big reasons why we are not using one polling for example so one of them is here the Orient in short what happens is that every time you do one polling request it's a four request so you are sending your full set of headers to set the for education if needed and so on and you are getting a full response meaning that we can actually get the case where we have 15 kilobytes of headers just imagine a general JWT token it can be in base64 it can hit then k easily like so you're transferring 15 Q bytes of headers backwards and forward to get one of two kilobytes of data which is the funny part and every time you need to do this you can you need to actually establish a new connection because you've waited some time and the connection is closed so to avoid the header overhead in one polling you can basically do nothing you can try to compress stuff you can try to send us a massless headers as possible but eventually you're hitting a point where you just need to transmit the headers the other thing is the maximum latency so how many of you know what is returns meet the right transmission one guy nice is hurry okay we don't go and hurry so when we are talking about maximal London see every time you establish a new connection you need to wait sometimes you need to resolve resource which is you know definitely different domain so you need to even wait for the DNS to resolve and this delays your data and it delays it in many ways over the mobile network because when I'm moving around with my phone how many of you use your phone in bus yeah right so do you browse the web in the bus do you use some web service okay so imagine you're using any service on your phone while you're moving any connected service so what happens is that you're constantly switching cells Network cells because one cell in the city has general area I think half a kilometer something like that so you're constantly switching cells but in the meantime you're downloading data so what happens is actually the data tries to reach you then you're moving to another cell then the data tries to reach you from another cell and so on and so on and so on so when you're in a fast car or in a car generally moving fast on a highway this is what you get this poor connection because the message almost got to you and then you switch to another cell so you're starting over so when when you're doing one polling this is like this is true for everything actually this is true it doesn't matter the technology but with one polling is the worst at least from what we observed then we have the connection establishment now you literally lose time to establish a connection and it can be avoided if you're using persistent HTTP connection but this is tricky also it's tricky because when you're using polling it's a synchronous like you're sending different poll requests and you don't know when they're going to come back so you need to keep open connections if they happen in the same time you're actually having a little benefit additional problem is general performance degradation because when you're polling the server needs to keep the data and respond to you but in the meantime it needs to keep it need to understand what is the difference between the data that was sent to you and the new data in order to be able to send you more debt so eventually when you walk the server more and more and more it needs to handle more and more data in order to send to you then we have timeouts we do but as we know sometimes they can take longer than we want in our case they take shorter in our case timeouts with the bowling there are proxies configured into course connections that are taking more than 15 seconds for example so you need to constantly say send keep a live bit between the server and client in order to keep this connection alive in order to reuse it now we already said multiplexing is possible but it's like a mirage it's possible if everything aligns perfectly in your case which usually never happens so moving to WebSockets WebSockets are kind of the opposite of long polling you have a persistent connection between the client and the server and you're constantly transmitting data in this connection into the the nice thing is that it's a duplex connection so the coins can the coin can send data and the server can send it the problems with this however are huge how many of you raise their hand that did a socket application how many of you had to do what go on sing for a WebSocket application from the three guys that raised their hand did you enjoy the experience they said no okay we didn't enjoy it either it turns out that proxies and firewalls are something that you never think of until it starts interrupting you and they interrupted us a lot it I started understanding about things like proxies reduce proxies blocked ports crazily configured firewalls for TCP traffic actually because WebSockets they are established over HTTP but with the great header which moves moves it to another layer so essentially firewall on this piece was able to block our WebSocket connection not nice experience and almost impossible to debug then the famous number of connections which 4hp request is like six do you know how many is the number of connections possible with WebSockets if anyone can answer he gets dessert it's not ten thousand it's not one okay unlimited is a correct answer so you're getting t-shirt I hope is your size because I don't know what size it is let's give vengeful gift okay so the number of connection is unlimited which means you can handle as many connections as your hardware can handle or your network so let's say I have 10 socket connections on my page as you saw earlier all my widgets are making their own connections so what will happen if I have 10 sockets on my page and I open few tabs with the same page my server will be basically working for this guy if he's that your connection can handle it actually but that's another topic so the number of connections is something really tricky with WebSockets and then you're getting to even harder pin because if I don't want to have 10 sockets I will need to manage only one socket connection which means also my widgets need to somehow talk to this convoluted API which is going to handle different requests over the same socket connection but WebSockets do not have multiplexing meaning that I will need to actually implement my own multiplexing or get third party multiplexing but the multiplexing cannot work on the on the server because this response is going to be multiplexed on send but something needs to understand it we need to seize it so I need to send some JavaScript to Harry's Nepali friends in order to for them to decompile the response and understand what I'm sending to them so I need to send more data in order to send more data then it's the load balancing now with one sink the tricky part is when you need to move users to a new server this is like especially if you have a micro services back-end actually moving users already working to a new instance first of all it will break off the socket connection so you need to somehow handle this on client the client needs to break and to establish the connection then the chain of events that can actually happen when you do that can actually trigger a massive massive flow of data that all of your micro services needs to gather in order to send the same data to this user why because when you move the connection you moved it to separate datacenter in a different place and all those already Scout architecture that you have on the back that is sending the data for one tenth century don't have it in the other one you need to dynamically double essentially we are moving to a point of constantly reinventing the wheel because with WebSockets we need to handle many things that are automatically handled on the HTTP protocol especially the multiplexing and the compression hurry hurry said that it's very good to compress your assets it's true I don't know why some people don't do it now imagine that you need to handle the compression on the server fine okay but then you need to handle the compression the decompression on the client because WebSockets do not have automatic compression it's not compressed protocol you need to really gzip your information in packet sent a packet and then my phone which I left here needs to unzip it in my browser it's crazy so at that point in time we are already in a situation where we tried weeks of work to understand what we can do and what we cannot do and we are getting into a place where we thought of how this effects the mobile phone the mobile phone so I started with the mobile phone I will continue till the end of the presentation besides them with the mobile phone in mind so the mobile phone needs to establish a connection so this is myself in a city you have hundreds of those but let's say for the sake of the demo now my phone has two antennas the design of the modern mobile phone has two antennas one is only receiving data the other is a full duplex antenna which can send and receive dead and this is important because the receive only antenna is actually wall power antenna and when you get when you get the hardware specifications of your phone they usually say instant the standby time it takes like seven days for seven days of battery life but if you're talking you get two hours so that's the reason because when you're talking you're using the photo blips antenna constantly so let's say I'm trying to open a web page because my case is connected to web service and when I want to do that my phone will put up the topless antenna and it will try to authenticate with some network that it can catch it will eventually do that then the cell itself doesn't do anything it just connects me to a larger network so it will connect me to the internal Internet service provider whatever then DNS yada yada yeah I will get to the web service that they want so although this is vastly simplified because networking is vastly complicated topic imagine this happens every time you send requests and it is constantly established connection if you have a WebSocket okay so when you are responding shall again so server you get the response in the same way back and this drains the battery quite a lot so then we get to the sec now what is interesting about SEC is that SEC is unidirectional you establish the connection once and then the server sends data to you proactively so it's a server push technology but you can no longer talk to the server so you're saying just send me data and then you are no longer allowed to send anything to the server the client subscribes and the server starts pushing date this is interesting because it goes only in the other direction meaning that we can turn off the topic Santana or actually the device is automatically going to turn off the duplex antenna from not sending requests so now we are going to move to some code I promise it's very easy and small month I'll show you some some quaint site and some server-side implementation if you have any questions feel free to interrupt okay so in on the client I'm creating this object of this new interface which Kotov add source and the only parameter that I need to supply is the URL then I do like on message event listener and I hand out the data that is coming so that's my client-side implementation like littering this is everything can you imagine how complicated the server I'll show you in a bit but let's first show you a few more things so on the client I have three main default messages which are allowing me to handle errors messages closed like make sense then I have the ability to actually show custom messages to handle custom messages meaning that I can send this string as a name of event from the server and I will be able to listen for it with the classic event listener now let's go to the server the server is like this like literally that's it this is the only function that you need to handle SEC on the server so whenever you get requests it needs to be signed to it a special header which upgrades it it's a eventsource header if you don't have this yet you cannot subscribe but besides that that's all what what I've written here is something that should not be handled in the same function obviously but for sake of presentation we need to set up headers we need to write our message and we need to send our message so this function if I call it with a response object it will actually send the message do you know how the message is sent can you infer it from the court code you see there is a t-shirt problem so sorry now not not through which channel the question is what in this code made the message to be sent what response right now it's a-ok I'm not joking this is my specification the moment you pass this drink in the message it's sent meaning that I can I can literally have ten lines with data data data data it will get concatenated and the moment I put this the message is sent I have no idea why it makes no sense like from API point of view it makes no sense to have it sent like that I would much prefer to have a like Todd sent or push or not whatever method which clearly and explicitly signs my message with the double lines forever but this is like wow you see something here this is this unique ID this unique ID is important because when I subscribe for messages and I lose my connection the second time I subscribe I will actually send this ID to the server and the server will know how many messages I missed and it can send and send them back to me so let's just look at the contract so we have unique ID we have the event we have this directory parameter and we have the data now the rhetoric parameter is very interesting because it can allow the server to say to the client stop asking me for data hold hold the connection and close the connection it means that after you do that the browser in ten seconds is going to actually try to establish the connection for data so actually the server can decide if there is nothing more to sentient it will know that okay I do not have anything for this guy for like 10 20 seconds just making sure on the client implementation that will handle this code is just this now it looks kind of bit like WebSockets but it's a bit less code a bit simpler something important any other field if you try to send additional fields and they will get ignored that's it these are the four fields that are accepted moving on the structure of the message you can actually create the stack of messages as I said earlier you're in a situation where connection got lost and I'm reconnecting and I'm telling you my last ID is 53 okay so the server knows how many messages I missed they're stacked and they can be sent together or them together if you do them like that so you can create a message or catenate great go cut that great and then put in two new lines so you don't need to send me three messages you're sending one message with the three messages now for the backend there are some specific requirements you cannot accept any header and establish a C connection you need to you need to accept only one source request you can only accept event source requests and you need to set up with the event stream mime type so that's given me you cannot do it in any other way you also need to contain a maintainer list of all the connected users in order to understand what are the messages they received and what messages are the difference and you should listen for dropped connections so you can remove those users it kind of sounds reasonable I didn't do it in the first time I had massive memory leaks without understanding why and you should optionally maintain history of the messages like for history because you can reconnect with an order ID depends on the client depends on the situation now as usual there are some very interesting edge cases which can make your day worse for example legacy proxy servers they have a timeout and they drop connections that look like they are not doing anything so I have a connection and the server doesn't have data so it's not sending data and the proxy decides that okay this guy just hangs there cut him so my brother banner establishes the connection going through this entire chain dr. pepper which is not nice in order to avoid this you can send one straight one character string like a command line every 15 seconds or so it will make the proxies think that this connection is life those guys are streaming data empty data but anyway you need to do it if you want to if you want to connect different connections to users like it's it's a bit more complicated because if you're relying on an IP address for example let's say when a user connects you decide okay disciple connected this is not correct because behind the same IP you can have many users so you need to find a unique way to identify your users so IP address is not reliable in this case another thing is another thing is that HTTP chunking do you know it just be chunking okay so for the guys that know just keep in mind that it can have negative effects on AC and then if we have HTTP per server connection we can hit that limit but anyway with the promise of multiplexing we should be able to handle that okay so let's revisit a picture this one is from few minutes ago when I was explaining how the connection works on general now with WebSockets and long polling on general we have this connection constantly running around there is a feature which is got connectionless bush which is documented and not used because of reasons the future connectionless bush means that you can actually stop proxy with the Internet service provider of your mobile operator and avoid the entire connection to this proxy so eventually your server will be communicating and will be keeping the connection established only with the proxy and only if there is data the data will be sent at some point meaning that you will not need to keep a connection life constantly it will also help with with this single comment just keep alive the connection in every 15 seconds this is like basically doing it for you now this is not widely used it is actually very similar to the web protocol how what internet was working additional thing how how many of you can identify the browsers that support this technology okay do you get a t-shirt yeah everything except I now catch I don't really care about ie and it's their own fault don't get me wrong edge does not support this and Internet Explorer 11 does not support this ie 11 will never support this obviously in edge it has been under consideration for more than one year but the good thing is that with JavaScript you can actually do a polyfill so there are polyfills for Internet Explorer however I don't really care because my main focus in this case is mobile so if you're not is the entire presentation is focused on how this is handling how this is affecting mobile use so as we all know the margin of usage of Internet Explorer on mobile devices is negative the negative number anyway so we don't really care okay so far thank you now I'm moving to a Wario working demo let's try this the good things with working demos are that usually I get blue screens nice one okay so I will show you client-server application the same application is actually uploaded in github so you can download it and play with it if you want what I have is the same same same thing that I had in the presentation it's just commented a bit and I will now press Start on my simple server how is this code visible for you should I switch the theme okay so on general you need to create some kind of web server I'm using the internal NPM package it's nothing fancy just we handle my requests you see that I'm testing a URL because my requests are sent to this you type URL if if I manage to find my URL correctly I use this function this function as stated earlier sets of headers you can see that here I've set up you cannot see why is it great okay now is it better or should I switch the steam okay so you can see that I've set up additional headers here because I'm running this invoker host and browsers nowadays are pretty panicking when you see when they see this kind of implementation working on localhost so I'm setting up these additional headers to allow my application to query from files from the file system but basically it's the same implementation so let's try to run it it did not explode so in theory I should be getting stuff okay so what's interesting here is that I have my event source object in the client obviously it's called CRC so let's see what is CRC everything that I shot so far in the presentation you can see in this object now the interesting thing is that there is a queue command and how was it called close yeah it's close so I can just close the connection and that's it this is how you manage the connection so this is how you establish it just event source my URL this is optional parameter just for presentational reasons what you need is really URL and that's it now if I decide to send special type of request I can just and I should be able to listen for it for my very original event okay I need to stop the server okay so now you saw that my event connected just fine and that's it you can send different events you can have different event listeners this for example makes it very easy to implement Groote applications which saw something changes on the server so you just and delete that at that change that whatever I want you to notice something I will kill the server and now the connection said it's time on timed out let me zoom in the console a bit so you see that my browser actively tries to establish the connection like it's desperate please give me this please so if I start the server again the connection you actually read stablish and it will continue to receive my messages now this is very nice because when you start doing code balancing you eventually see that you're losing one connection and it automatically goes to another so let's try to do the word balancing them how many of you have any experience with nginx ok nice so you're going to help me run it now I I did that in advance let's check yeah I did it in advance so this is my this is like a home page for nginx default configuration just I filled it with HTML to help me remember stuff and this is the page which is going to try to connect to my notes now I will start a few notes oh I need to run my just a second okay so now you see I have some error messages but that's mainly because some of my nodes are offline so I cannot connect to them what is it do you think is that I have one working not so I connected to it so now let's make everything else working nice okay so now we've established a connection you can see some letters here a this a means that I in the code you can see that I started five nodes but I'm receiving only three messages right so all those five nodes at working what's interesting is that I put up two nodes for the first two addresses and I boot upon not for the last one meaning that if I kill the first the first process 13:19 I should get an error because I lost connection and then the connection word was automatically arrests AB lished in the second node in not be what will happen if I revive not one should the connection move it will not move obviously but this is like if I tell you how easy this is to set up you be amazed since few people said that they know nginx do you want to see the configuration file okay ah I made a typo now a good way to look smart is to use vim to preview files a good way not to look smart is to up using vim alright so let me minimize everything besides this what is interesting here is I have something that's called upstream is treatable should I increase the font okay let me try to increase the font okay so I have something that is called Lupe's dream now the upstreams are like a simplified terms what's behind the door these are my upstreams connect them through those holes in the door so I have three OOP streams configured and as you can see I have two nodes working for one upstream two nodes working for the other and I have two for the last one but I put it only one so it doesn't matter then I have some very very simple configuration for the server and since I have certificates from has been tucum using them why not so you have configuration for HTTP and configuration for HTTP and I'm not joking this is literally the default configuration I just changed the URL to the certificate that's it part of the default configuration as well and this is the interesting part so this is where as I set up my locations my locations are basically the URL that I want to access so swosh t1 and t2 and so RT through three diesel the URLs and the maxi accessing in the client application so if I open the source if I open the source you are going to see that I'm connecting to t1 t2 and t3 so these are my my locations then I do the same like in the other example the not just server if you remember I was setting up the headers so on setting up headers per location basically all the headers why not and then you said what happens with Boston gets requests and then you do it for the other locations the same 42 and same 43 now much smarter people than me can do this automatically without cops pasting code at nginx is not my area of expertise so this is the best I was able to cover okay so let me show you one of the graphics in the network panel and why is it interesting let's refresh the page and please zoom in how many connections do you see here yes that's the idea so basically all of my traffic right now is moving over one connections over one connection only one this is it and what will happen if I cue a note Alki refresh the bedroom I was on the first note oh sorry him as you can see there was no additional connection at establishment you just continue using and why because it's over HTTP - because it's coming from the same source and because of these reasons I'm just reusing the connection and stuff multiplexing cover it something interesting the notes behind are not all HTTP to servers so let's open quickly and we're going to move the questions as you can see this is not hb20 but all the data that I'm doing that I'm getting from it is multiplexed together with the HTTP 2 servers that's because my ingenious is handling this for me which means that I can have simple structure in my packet I can have simple server simple nodes that don't know what is a certificate what they don't know what is the header and all this is moved to and handled in the nginx and this is what only SEC allows me to do ok guys since we are moving forward with time I am open for questions after quick summaries away we've looked about long polling we talked about quickly about WebSockets did a quick demo on AC to have any questions on it yes if the question is nice you're going to get a t-shirt as well hi I am so those solution that you describe if the right use cases when you think that one solution is much better than the other for instance if you build chat application maybe WebSockets will be better than the others or because they are more or less solving the same problems but maybe in some specific cases you can tell that's actually a very good question and you deserve more than one t-shirt but that's not how it works what what's interesting is that with WebSockets in theory it makes sense to develop chapt application but what is interesting is that when you're doing a group chat for example the users are not as active so one user may not be typing any messages so why he should be keeping this connection open on his device constantly so it makes much more sense to have a chat application implemented in this way if it's handling work chat rooms in this case it means that every message you type is going to be a separate request because with sec you cannot send data over the connection you need to do actually new requests but depending on the performance requirements that we have and since we're Muslim aiming at mobile it makes sense to implement my chat application using sec just to deliver the messages in in a better way and only when users are active to make requests to send the messages so again depends on your use case but real-time communication if you think about it real-time communication is fairly is very rarely needed let's say I'm delivering commented to data with SC and I have a purchase so the customer wants to buy something from a shopping cart okay it's okay to make a new request for the shopping cart again it will need to take this additional time to establish connection and everything but it's okay to do it in that case you don't need to maintain open to absorb connection for two minutes just so the user who used the shopping cart once makes no sense so depending continues case you can do very very different implementations but SEC looks very promising and it's also been around since to town 2009 shortly okay the guy did not want thank you for a presentation I have two questions the first is server-side events are they different from the position of the far from four firewall than the WebSockets so when we have the same problems with firewalls and the second question is it there from the position of wild development the reason is obvious the difference is obvious because we have different channels but if we're developing for the desktop either the reason is there a difference between server side bands and web sockets okay so the first question is if there's a difference for the firewall between web sockets and advanced so this is like - it depends because if the firewall is filtering could this be traffic server sent events are not going to be affected by it okay because the web socket is is established with an upgrade header and it's moved from the HTTP ler tortise pillar from the application through this pillar meaning that it moves it literally is on another level of the OCI model so if you have a firewall that is filtering this bit traffic you can get affected but this is not going to get affected so it really depends on the firewall but web sockets are ons also so knowledge is available currently I'm talking exactly about web sockets they are yes SEC is not and word whatever level or the source at events HTTP it's on the application oh sorry HTTP is on the application layer right I'm not sure right now first of all Seneca faced each question you said later that if you open the second tab is for example socket connection we have two video have two circuits connection but as if I understood correct if we did made it this year we will have two connections to do okay if you have on the same page in my case in the beginning I was explaining who you can have ten connections per widget on the page okay so it means that with HTTP two and SEC you actually get to one connection if you're using WebSockets you are getting ten connections so if you open two tabs with SEC these are two connections with WebSockets it's 20 so WebSockets multiply if you don't multiplex them on your own no no because with with the multiple tabs the problem with sockets is on the client machine not so much on the server because with multiple taps you get into a situation where your machine is out of resources literally your PC cannot handle any more t-shirt and also for the firewall guy t-shirt are you going to catch it I'm sorry yeah and also the question is about we discussed it actually the question is about data compression so we don't have the compression of data so zip on WebSockets by default by design years and how about this is a sea that's a bit tricky you don't have it by designing the sea as well but since you're going to run genex you can have it from nginx so nginx does magic for you as well as HTTP - did you get the t-shirt already okay thank you for the presentation I would like to ask did you use this in production yeah and it's work well yeah and what tricky parts do have read it could you repeat this what IH case which tricky parts do you have well I explained them during the presentation okay I will it's fine I will repeat it's mostly okay I see half screen only in just a second thank you for pointing okay so one of the edge cases is with proxy servers which are closing the HTTP connection this is this is why we need to send empty messages literally messages with a command character just to keep the connection alive the keepalive message another one is with how you identify the user because we are sending kind of personalized data to our users we had to find one it's not like I have like regional I'm not taking like everybody from Germany and sending them the same content so I cannot filter users by eye piece so I need to find a different way to filter the user and what he's subscribed to in order to keep a structure of the messages because we are using micro services with actor model meaning that we are trying to scale automatically and stuff like that it was kind of tricky to actually understand which user what they want and in order to optimize understand if we have users with similar type of data and reroute them to the same actors so it was kind of candy each case and I guess most of you will not have this kind of edge case but with personalized content it's kind of tricky okay thank you you have t-shirt they want I would like to I think it's the last one now I have one more actually the last questions thanks for your speech so if we talk about okay you said that we would receive the messages if we were offline yes so can we limit these messages and now you cannot receive messages for your offline you you said that we provide this unique ID yes yeah so if we miss something we would receive them correct yes but if you implement it in a way that you track the difference that was sent and that was received okay so I should implement this by my own okay thanks you need to understand what the user is subscribed to what the user received and if it loses a they loses connection and they are connect you need to understand if they have a difference so you can send all the messages they missed okay thanks Thank you very [Applause]
Info
Channel: Fest Group
Views: 9,495
Rating: 4.9471364 out of 5
Keywords: SSE, WebSockets, Long Polling, js, javascript, conference, short polling, server sent events, WebSockets js, WebSockets angular, WebSockets spring boot, WebSockets flack, WebSockets go, WebSockets react, WebSockets python, WebSockets javoscript, WebSockets chat, Long Polling js, Long Polling php, Long Polling javoscript, Long Polling node js, long polling vs websocket, long-polling vs websockets vs server-sent events, long-polling c#, ssethtzeentach reaction
Id: n9mRjkQg3VE
Channel Id: undefined
Length: 57min 49sec (3469 seconds)
Published: Mon Aug 12 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.