live site updates

Izi

Izi

Soldato
Joined
9 Dec 2007
Posts
2,718
so i have been tasked with creating an ajax app which alerts users whenever data is updated on a site. the site has news articles, blogs user comments, forums etc etc.

i need to create a panel which updates automatically via ajax when ever a new article, comment or otherwise is posted.

i have thought the best way to do this is to create a windows service which runs everything 15 seconds. it searches my specified tables for changes, then inserts them in to a specified table, ie tbl_alerts.

in tbl_alerts will be item id, item title, item posted time, item url

the ajax panel will automatically refresh every 5 seconds and show if there are new items in tbl_alerts.

what i was wondering is if there is a better way of doing this, or is there a way to 'push' the data to the user without an ajax panel doing a lookup in the db?

thanks for any help.
 
Could you not just add it, that when a new article is added/updated in your sql table, that it sends and insert statement to another table called updates?

You then have a thread monitoring the updates table on your server, and get that to send notice to all connections?
 
Could you not just add it, that when a new article is added/updated in your sql table, that it sends and insert statement to another table called updates?

You then have a thread monitoring the updates table on your server, and get that to send notice to all connections?


the reason that i was not going to do it on insert is because i think it would be quicker to create a service. there is probably about 50 scripts which would need to be updated to do it that way, where as the service i wud specify the tables i want to listen on and get all articles since the last time the service ran. (IE SELECT * FROM tbl WHERE date > lastrundate)

About the thread, can you explain more? how can you send a notice to all connections?
 
Back
Top Bottom