educative.io

Educative

Maintain long poll

To efficiently handle this, users have to maintain a Long Poll request with the server for receiving the updates.

why is the long poll involved? when the person who the user follows makes the post, don’t we just update the cache? if the user want to see the new content, he can just refresh his page. is long polling only to save the refresh?

i think two things are mixed up in that passage. Long Poll is how the newsfeed is delivered to the user. the other thing is how those results are constructed. fanout-on-write or fanout-on-read are about how the newsfeed is aggregated/constructed. if you adopt a hybrid approach, part of the newsfeed is already pre-computed for your consumption, the rest, from your very famous friends, will be extracted from the ‘celebs post’ cache and aggregated with the pre-computed ‘newsfeed cache’