Hacker News new | past | comments | ask | show | jobs | submit login

...oh, I just re-read the great-grandparent. I didn't realize the application's servers were talking to Google's servers, I thought the application was talking to Google's servers directly. That seems terribly convoluted, although I assume there's actually a sound reason for it.



The push servers (Google, Apple, etc.) effectively work as a message queue server - they aggregate and batch payloads and send them to the devices. The devices keep a single persistent HTTP connection for reception of all possible messages.

It's built like that due to efficiency - the devices need to minimize number of radio and CPU wakeups to keep running on battery. In early days of Android each app handled this by itself. This resulted in apps polling their servers on fixed interval (e.g. every 5 minutes, etc.) which caused a disastrous tragedy of the commons and horrible standby battery life.

This is why the approach was changed to mandatory push services - the long-lived TCP connection, push aggregation and radio management have significantly prolonged battery life.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: