My app resets usage credits every month. For example, if a user signs up on Aug 30th, his/her usage credits will be reset every 30th of the month.
Which is a better implementation?
Monthly recurring workflows.
Keep track using these fields: Current Month Credits Used, Current Month Start Date, Current Month End Date
Compute on the fly.
Sum up current month’s credits used every time it’s needed, from the day of sign up + current/previous month, up till now.
#1 seems to be simpler, but I’m not sure if there are computational concerns (say if there are thousands of users) or surprises (will there be a case where the workflow fails to run?). And if there’s a bug in my implementation, it’ll be harder to fix.