I was asked to design a collaborative file-sharing service as part of the interview discussions with them.
Based on a video that I had seen some time back related to scaling of Dropbox (), I had an impression that this service as well can use long poll. However the interviewer was not convinced with it and countered that:
It is a collaborative file sharing service being used by millions. Imagine there is a file being edited by many users at the same time and if you use long-polling, then it would be very inefficient.
I was not sure about this part and did not have any convincing answer for this.
Can someone point to a link/video/reference paper that demystify :
- When to use Web-socket
- When to use Long-polling
- When to use Server send events
Based on my understanding, I have listed down some usecases and what they will use. Please help critique this as well:
- Google Docs - Long poll
- Collaborative text editor - web socket
- Dropbox - Long poll
- Facebook messenger/whatsapp - Websocket
- Uber (communication between server and passenger) - long poll
- Uber (communication between server and driver) - long poll
- Food delivery app (say Pizzahut for communication) - long poll
- Bank app to deliver OTP - web socket
- Collaborative code editor - web socket
In case someone can point how these are implemented then it would be good.


