Ordering in a real-time news feed
A real-time social news feed receives incremental WebSocket events and an initial REST list. To make sure no events get lost during the initial sync, in what order do you wire up the two channels?
A real-time social news feed receives incremental WebSocket events and an initial REST list. To make sure no events get lost during the initial sync, in what order do you wire up the two channels?
Open the WebSocket first and start buffering events, then fetch the snapshot over REST, and apply in order only the buffered events whose sequence number is higher than the one in the snapshot, so nothing that happened between snapshot creation and socket connection gets lost.
iOS system designShort answerAdvanced
Design an infinite-scroll feed screen like Twitter's from the iOS client's point of view…
#realtime #feed
iOS system designMultiple choiceBasics
A stock app needs a watchlist screen (prices updating several times a second in the…
#websocket #realtime
iOS system designShort answerAdvanced
Design a portfolio and watchlist screen where hundreds of symbols change price dozens of…
#websocket #realtime
iOS system designShort answerExpert
Design the iOS client for a 1:1 chat like WhatsApp. Focus on message ordering…
#websocket