Schedule morning and evening reminders for the each user in the database based on their timezone in NodeJs

30 views Asked by At

I am trying to build an application where the users can be sent a morning and evening reminder based on the time that they select. I looking for ideas as to how to acheive this. There could be users from different parts of the world in differnt time zones and I want to schedule a cron like behaviour that periodically sends notifications to these users in their timezone.

For eg. A user selects 6am and 7pm as his reminder time then we should trigger a notification from the server to the client at 6am in the user's timezone (let's say Asia/Calcutta, or any US timezone)

  • I tried scheduling local reminders from the client but android/ios have background execution restrictions for every app that is hindering and feels a little unreliable. So I trying to get this done via the server now.
  • I don't think cron jobs can work in this fashion since this involves user's timezone and we would then need to run a cron for every user (imagine 1000's of users in the db and that makes me think that it can be a performance bottleneck later.)
0

There are 0 answers