Hacker News new | ask | show | jobs
by Woost 5387 days ago
Percona always seems to have good articles.

I think, as he said, everyone shouldn't run out and replace a mysql job queue for their wordpress blog. In a great many cases it doesn't matter.

I also like how he never said "Don't use mysql as a queuing system" but "be careful of these things". I've used mysql as a queuing system, and it works fine. I looked at replacing it with a different database, but in that situation it was not worth the investment.

Signaling mysql + archiving performed work + no locks that lock more than the exact row that's being updated (and also avoiding concurrent workers acting on the same task) will take a mysql backed queuing system far. I've set up a system that processes well over 5,000 tasks / day using it.

Do I think everyone should use mysql as their queuing backend? No. People should probably use a queuing library, with persistence to a database (redis?) enabled for critical tasks. Of course, as the article said, be careful about the choice of backends.

2 comments

That is about one task per 50 trillion CPU cycles, you would be hard pressed to write a queue implementation that is to slow for that. Numbered files in a single directory on a synchronously mounted filesystem designed for few large files that only allows linear directory scans might qualify, but I am not even sure about that.
5000 tasks per day is of course far from limit. we used to build Mysql queues that process close to 100 tasks per second.