If you have found yourself using mysql as a job queue, eventually you have to deal with the unpleasantness of removing old data from your database.
Don’t do this:
Depending on your database, writes may get locked out and if nothing else your DBA’s will thank you for not making the mysql slaves lag behind master.
A nice tool for jobs like this is Percona’s pt-archiver. Its a beautifully simple tool that does one thing and does it well. It can move data out of your database efficiently and without negatively impacting app performance.
I am using something like the following to archive data into a read only analytics database.
Hope this helps someone find pt-archiver.