2

I have an application where users can collaborate on photo albums. I currently use polling on the client to check for new content every 30 seconds. There can be any number of people uploading and viewing an album at any given time.

On the server side, I cache the data to return (so the query for new content is cheap). I assume that polling every 30 seconds from multiple clients will cause more instances to stay active (and thus increase costs).

Would it be overkill to use the channel api for the above use case instead of polling? Does the channel api keep instances alive too? Are there any use cases where polling is preferable instead of using the channel api?

Rob Curtis
  • 2,245
  • 24
  • 33
  • This would depend on several factors including number of users and frequency of reconnections. Remember the cost associated with channel api - 100 free channel connects per day, then $.001 per after that. Channel works great if you can keep connects to a minimum. – rGil May 17 '13 at 13:08

1 Answers1

1

I'm using channels but I'm finding they're not great. If a channel times out from a network disconnect, it somehow screws up the history on my browser. I've filed a bug a bit over a week ago, but it hasn't been acknowledged. There's another bug filed over a month ago that hasn't been acknowledged either - so don't expect quick support on channel issues.

Channels are nice to have - you can notify users in less than a second if status of some sort changes, but they're not reliable. Sometimes the disconnect event doesn't occur, but the channel just stops working. My current system uses channels, but also polls every 5-10 seconds. Because of the unreliability, I wouldn't use channels as a replacement for polling, just a way to give faster response.

Even then you'll have to work out whether it'll save you money. If you're expecting users to leave your app open for 15 minutes without hitting the server, then maybe you'll save some instance time. However, if your users are hitting the server anyways, your instances probably wouldn't get time to shut down. And keeping your instances up actually helps reduce cold starts a bit too.

dragonx
  • 14,963
  • 27
  • 44
  • Can you include links to the bugs. Can you also provide backup examples of channel api failing (other than anecdotal evidence)? – Rob Curtis May 18 '13 at 04:50
  • I recommend looking through the active issues for the Channel API in the issue tracker. Try this: https://code.google.com/p/googleappengine/issues/list?can=2&q=channel&colspec=ID+Type+Component+Status+Stars+Summary+Language+Priority+Owner+Log&cells=tiles – dragonx May 18 '13 at 17:11
  • As for evidence, it's all anecdotal. If you search through the google group messageboard for GAE, you're not gonna find much praise for Channel API's reliability. – dragonx May 18 '13 at 17:12