How does facebook, gmail send the real time notification?

前端 未结 5 907
梦毁少年i
梦毁少年i 2020-11-22 09:55

I have read some posts about this topic and the answers are comet, reverse ajax, http streaming, server push, etc.

How does incoming mail notification on Gmail works

5条回答
  •  北海茫月
    2020-11-22 10:37

    Facebook uses MQTT instead of HTTP. Push is better than polling. Through HTTP we need to poll the server continuously but via MQTT server pushes the message to clients.

    Comparision between MQTT and HTTP: http://www.youtube.com/watch?v=-KNPXPmx88E

    Note: my answers best fits for mobile devices.

提交回复
热议问题