In my app, I have a schedule option where user can select any time to send a mail to other users. We’re expecting lot of users to use this feature. So at any given minute there might be hundreds of messages we need to send out.
What is the efficient way to this?
Only idea I have in mind is creating a cron job which runs every minute and check for the messages needs to be sending out.
Anyone knows any better way ? something like queuing services where we send a call and at the scheduled time triggering webhook or something like that.
Another option might be percolate:synced-cron. Its simpeler in my experience and have never had any issues. Just keep in mind that its not being maintained actively anymore. And although the name suggests that its just a cron script. You can actually use later.js syntax to schedule either repeating or single jobs
I’ve used both synced cron and job collection, and had better luck with job collection (unfortunately I don’t remember why…). I’m going to be setting it up again in a project shortly, hopefully it’s still fun to use