'Sidekiq dilemma : one scheduled job per user, or one job executed every day once for all customers?

I have a Rails 5 App with Sidekiq installed and I am facing a dilemma. Let's say we have 5.000 users who subscribed over the last 30 days to our app, and we need to increment every 30 days, by 30 days, the subscription date saved in our database.

Is it better to set up one scheduled job through Sidekiq for each new user with Sidekiq::ScheduledSet.new, renewing itself every 30 days, leading me to having constantly 5.000 scheduled jobs? Or is it better to have one job running one time every day, checking over all the users if their subscription date saved in the database matches a D+30 date before incrementing?

What is the best practice? What is the most efficient?

I suppose the answer could depend on the size of the database but as I'm quite new to programming, I'm really hesitating. Or maybe neither of those solutions are good.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source