Seriously, why haven't I heard of this before. This has to be the single most awesome feature I've ever heard of. Apparently MySQL (by adding a single flag in the config file) supports execution of statements at regular intervals. I am currently working on my online browser-based HTML5 game (Celestial Empires Online) and have gotten to the point where I need constant data manipulation in the backend (not user generated), so I started researching the best way to execute MySQL stored procedures/functions from CRON when I ran across this:
CREATE EVENT myevent ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO UPDATE myschema.mytable SET mycol = mycol + 1;
Now the entire game backend can be ran completely within MySQL, using only apache2 as a transport system to pass data to and from mysql. No managing of connections, no persistence needed, no custom code or shell scripts. Just MySQL, PHP/Apache, and the user's web browser/javascript.<br><br>The web sure has grown up :D