Thursday 21 December 2017

How Do I: Create CRON based scheduling service for multiple user accounts

I'm trying to create an app where users can schedule automatic emails, or tweets, or w/e to be sent out on a schedule. Each individual user has an admin panel where they can update their own schedules.My question is about how I can do this in a well-tested, performant manner.Option 1: I know I can open a new cron task for each user, and update it anytime I need to, and even destroy it when I need to, but I wonder if I have 100 users, that means I'll have 100 individual cron jobs running. That sounds like it could be an issue pretty quickly dramatically slow down the server.Option 2: I don't even know if this is possible but... something along the lines of having a single cron that records all tasks for all users, so then when a task needs to happen, it can run that task for each user it needs to. So maybe at noon, on Tuesdays, it gets an email from user A and a tweet from user B and sends those both off to their respective services. Is that possible?I'm open to other ideas as well. I've never attempted something like this, so I just have no idea...Stack: Node, Express, PUG, etc etc Cron Job provided by http://ift.tt/2teQFKz

Submitted December 21, 2017 at 10:53PM by SableElephant

No comments:

Post a Comment