Log in

View Full Version : Need Suggestion On How To Get Automated Notification Simillar To Facebook



hemi519
12-20-2012, 03:03 PM
Hi All,

I am developing a app which has the functionality similar to facebook. I want to know how can i get notification like they have in their app. I have done everything, whenever i refresh my page i will get new notifications. But i dont want it to refresh everytime. It should be automated, whenever my friends comment on my post, i should get a notification in my page without refresh. That means i have to pull the data from database when ever there is any new row in my "db table".

I have approached this by creating a div and through jquery i am refreshing it every(1)second. Page is not refreshing but my issue is every second i am interacting with DB to check new updates. This will be issue if i am having 1k members in my site. Is this correct approach? If not please let me know how can i get this solved?


I heard about comet notification, but there are some issues with speed when my site user counts go more

keyboard
12-20-2012, 08:40 PM
Using jquery with standard ajax will result in a lot of unneccasary requests to the server.
In case you're curious, Facebook uses comet.

Have a look at this jQuery plugin (http://archive.plugins.jquery.com/project/Comet). I've never used it and it seems quite complex, but you could give it a try :)