4 ms·
I move everything that requires doing more work than just processing and displaying data to a simple little batch server. So, for example if you submit a conta
by mrtron 19y ago
I move everything that requires doing more work than just processing and displaying data to a simple little batch server. So, for example if you submit a contact us email, it doesn't email immediately. It just stores the info from the form and sends a signal to the batch server.
It seems trivial, but it is quite important.
- lux 19y agoThe other great thing about this is that your batch script can essentially keep plugging away behind-the-scenes when the data set to process is larger (e.g. a newsletter list to send). So even if something goes wrong and the batch script fails, by maintaining a queue and monitoring the script via cron, now you've got a level of simple fault-tolerance built in.
- jmtulloss 19y agoAssuming your queue doesn't die with your script :)
- mrtron 19y agoCorrect. Those sort of cases were the main motivation for building the batch server. In regard to the other point: the batch server should never fail since tasks are spawned off as another thread, and even if it does, the tasks are in fact stored in a database. Fun times!