deansatch Posted January 28, 2010 Share Posted January 28, 2010 What is the best way to check to see when a mysql db has been updated in a sort of realtime situation? e.g. I can have a page and using some ajax I can have it select and display stuff from the db every 2 seconds so I will see entries appearing on the page in realtime. I imagine this would put some strain on the server - I only need it to retrieve info if there is something new to show - what is the least stressful way of doing this? Link to comment https://forums.phpfreaks.com/topic/190134-ping-a-database/ Share on other sites More sharing options...
Mchl Posted January 28, 2010 Share Posted January 28, 2010 (For example) When inserting new data, touch (i.e. update modification time) a file in a filesystem. Then just monitor this file's modification date. Link to comment https://forums.phpfreaks.com/topic/190134-ping-a-database/#findComment-1003189 Share on other sites More sharing options...
deansatch Posted January 28, 2010 Author Share Posted January 28, 2010 Thanks for that - would checking the modification date of a file every 2-3 seconds have a serious effect on the server performance? Link to comment https://forums.phpfreaks.com/topic/190134-ping-a-database/#findComment-1003196 Share on other sites More sharing options...
Mchl Posted January 28, 2010 Share Posted January 28, 2010 Less than querying database anyway. Link to comment https://forums.phpfreaks.com/topic/190134-ping-a-database/#findComment-1003200 Share on other sites More sharing options...
wee493 Posted January 28, 2010 Share Posted January 28, 2010 Thanks for that - would checking the modification date of a file every 2-3 seconds have a serious effect on the server performance? It shouldn't be too bad, but if you start getting many users on your site at the same time it's going to kill it self. Link to comment https://forums.phpfreaks.com/topic/190134-ping-a-database/#findComment-1003293 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.