Scalable solution for website polling
- by Tom Irving
I'm looking to add push notifications to one of my iOS apps. The app is a client for a website which doesn't offer push notifications.
What I've come up with so far:
App sends a message to home server when transitioning to background, asking the server to start polling the website for the logged in user.
The home server starts a new process to poll for that user. Polling happens every so many seconds / minutes.
When the user returns to the iOS app, the app sends a message to the home server to stop polling.
The home server kills the process polling for the user.
Repeat.
The problem is that this soon becomes stupid: 100s of users means 100s of different processes. It's just not scalable in the slighest.
What I've written so far is in PHP, using CURL to do the polling and I started with PHP a few days ago, so maybe I'm missing something obvious that could help me with this.
Some advice would be great.