Search code examples
c#entity-frameworksignalrhangfire

Sending mass notifications with signalR and hangfire, saving server resources


I'm programming a SignalR push notification system that uses a hangfire task to push notifications to all the users, lets assume i have 10,000 users and i want to notify them when their account is one month old in the website, what would be more efficient? Assigning one scheduled task per user to be executed one month after the registration or having a Hangfire task that runs daily and finds me the users that have one month old accounts and notify them.

The task to assign to hangfire will be the following:

  • Deactivate inactive profiles and send an email telling the user their account has been deactivated.
  • Close posts or inquiries that been inactive for x amount of time and notify them via notification
  • The system should be able to find top 10 posters and notify them via email and website notification they have been selected to have extra benefits.
  • The task will notify in real time every hour to all the users what was their best score for that week.

Thanks in advance.


Solution

  • Your solution sounds extremely complex for something as simple as this. Are all of these users online all the time? So do you really need to use SignalR for this? Or even Hangfire?

    Normally you would do it like this, when user loads a page check if account is over month old and show notification in the UI. Or is there are a reason you can't do it like this?