Scalable solution for website polling
Posted
by
Tom Irving
on Programmers
See other posts from Programmers
or by Tom Irving
Published on 2011-11-25T14:07:44Z
Indexed on
2011/11/25
18:03 UTC
Read the original article
Hit count: 363
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.
© Programmers or respective owner