We are using .NET 6, Hangfire.AspNetCore 1.7.31 and Hangfire.PostgreSql 1.9.9. We would like to implement a way for users to subscribe to email notifications where they can choose their own notification interval. If you are familiar to Jira, it is very similar to its filter subscriptions.
We see two ways of implementing this functionality:
RecurringJobfor each user subscriptions, each with its own time interval. How does this scale to 1000s of users? Does Hangfire create a separate thread for each
RecurringJobs be added at the runtime when user subscribes to a notification?
Have only 1 frequent
RecurringJob(ex. every 1 minute), which checks which users need to be notified and sends an email.
Which option is the preferred way of doing it in Hangfire? The solution should be as efficient as possible.