This project focuses on connecting mentors and mentees on a daily basis.
A job scheduler is required to automate this process.
I have written the code but need a second opinion on how to improve the performance in terms of memory and time. This might include improvements to the setup of the collections and / or improvements to the way I use the mongoose ORM and / or the way I structure my steps in code.
Stack: Node.js, Mongoose, MongoDB
The stack should account for scaling to 1 million users
Fault Tolerant Daily Scheduler
- Scheduler runs two types of jobs: scheduling daily profile and notifying user of new daily profile
- There are 2 types of users: mentor and mentee
- The scheduling job schedules the next daily profile for each user in the collection
- The daily scheduling should be 1-1
- E.g. If mentor A is recommended mentee A, then mentee A is recommended mentor A and not mentor B
- Profiles should not be scheduled for a user if they’ve been scheduled before
- If there are spillover mentors or mentees, then default to scheduling a user that hasn’t been scheduled before
- The notification job executes at 9am in the user’s timezone