This is more of an implementation question, but are there any shortcomings to using something simple like cron to schedule tasks like mapreduce for MongoDB? Say something needs to be executed every hour, it seems like a suitable way to do this... But I guess I'm just asking because of all the popular job queuing systems out there like Resque and others.
I suppose my question is more like, does cron provide solid and reliable enough solution? Thoughts?
Cron has been used for decades and is quite reliable and solid; if your cron isn't reliable then I'd suggest that a stern discussion with your OS vendor is in order. Also, the MongoDB documentation talks about cron jobs (google "site:mongodb.org cron" for examples) so, presumably, cron jobs are to be expected with MongoDB.
That said, if you already have a bunch of infrastructure set up for another scheduling system then there's probably no reason to use cron for MongoDB and something else for other tasks.
In any case, you'll probably want to layer on a simple PID file locking system if your cron jobs might take long enough to overlap and you only want one running at a time:
atexit
handler or whatever similar feature your environment supports).If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With