I need an advice. I have a procedure which is calling another procedure in MariaDB. They both are calculating distances and times and put them in a table. I need this calculation to start every night at 23:59:59. The procedure which I should call have two parameters - from_date and to_date. My question is -> which is more appropriate - To make a php Cron which will call my procedure or to make an event in MariaDB? And if you think that the event is a better solution, can you tell me if it is possible to calculate today's datetime in it for date_from and add 24 hours to it to calculate date_to? Thank you in advance !
Asked
Active
Viewed 66 times
1 Answers
1
Short answer: PHP, Cron and Bash
It solely depend on your procedure and how many rows will be processed and affected. Query complexity inside the procedure also play important rule.
In short, if your procedure is light weight, you wont notice the difference of both.
But, for daily use in production server, I prefer to use PHP, Cron and Bash to do the job, because it offer much more control on how the job will be conducted. I can add pre-checking, including system load and condition, before executing the job, including checking each input row and affected results rows.

dwi kristianto
- 159
- 2
- 11
-
Thank you. From your answer I assumed that the better one is Cron in my case. – Даяна Димитрова Oct 11 '21 at 05:17