Search code examples
androidiossocketssynchronizationtrello

Mobile live synchronization (eg Trello): sockets?


I was wondering how live synchronization mechanisms such as the one used by Trello work.

For example when I move a card from the website, the board is immediately refreshed on the iPhone too. As Push Notifications are not reliable, I suppose a sort of open connection/socket stream is used under the hood.

socket.io quotes Trello among its users: does anyone have any reference about Trello's mobile implementation?

Thanks, DAN


Solution

  • Trello uses a combination of WebSockets and polling to perform instant updates. Most clients use WebSockets all the time; the few that don't support WebSockets use short HTTP polling instead. It also uses a single HTTP poll to "catch up" after losing a WebSocket connection and reconnecting.

    The iOS and Android apps connect using socket.io clients that are locked down to only the WebSocket transport. The web client uses raw WebSockets. On the backend, socket.io is used only to support the handshake and protocol expected by the iOS/Android apps; all of the pubsub/message routing is custom.