Question

I'm developing a website that uses a notification system (like the Facebook's one). For this purpose I think I'll write a JQuery polling function that look for new notification in the server side, using ajax.

My question is, is this a good idea?

Was it helpful?

Solution

It will be ok for client side, it's more likely to be a server issue. http://swerl.tudelft.nl/twiki/pub/Main/TechnicalReports/TUD-SERG-2007-016.pdf

In conclusion, if you want high data coherence and network performance you should use push rather than pulling. But push will consume more cpu thus has scalability issue.

The efficiency of pulling depends on the pull interval vs publish interval. If they equal, everything will be perfect. But realistically they will never meet.

Some additional personal opinion, if your server script is blocking in nature (like ruby on rails with single thread server). You better rethink the solution.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top