Im using php/mysql and have to update a user's counter at a given frequency from their creation date. For category1 users, the counter increments after every 24 hours for 3 days, for category 2 after each week for 4 weeks..
I thought of creating a trigger on users table so that after each insertion I create an event that starts at the creation and has the desired frequency. But I don't know how the DB could react especially that several thousand of events will be created.
Other possibility is a cronjob that will check the creation date, category and the last occurence every hour for example. But this will not match the date/time of creation and also have to check every row to do the job when the update is not applied to some users.
which approch is best and won't impact the DB performance (very large number of users). Is there other efficient way to do this?