Let's consider the following estimates for capacity and bandwidth:
Based on these estimates, we can calculate the required capacity and bandwidth for the Task Scheduler system:
Considering each task data size as 1 KB and the creation of 6000 tasks per minute, the system will need a database capable of storing and managing this data efficiently. Therefore, the database should be able to handle a large volume of data insertion and retrieval operations.
createTask - creates a task
input: task name, code function to be executed (this could be literal code passed in or reference to some file with entry point)
output: creation success or failure, 201 https code response.
scheduleTask - schedule the task for a specify time to run
input: date time to execute the task, name of the task to be executed
output: schedule success or failure, 201 https code response.
executeTask - immediately executes the task by queuing it up.
input: task name
output: job id
rescheduleTask - reschedules the task for a different time to run.
input: job id
output: job id
listTasks - list tasks
input: none
output: list of tasks
updateTask - updates a task
input: task name, code function or reference to code file
output: update success or failure
deleteTask - deletes a task
input: task id
output: success or failure
The database will Stores task metadata and execution logs.
task metadata table
execution logs table
task status
recurring tasks
You should identify enough components that are needed to solve the actual problem from end to end. Also remember to draw a block diagram using the diagramming tool to augment your design. If you are unfamiliar with the tool, you can simply describe your design to the chat bot and ask it to generate a starter diagram for you to modify...
database
monitoring service
notification service
task scheduler service
Explain how the request flows from end to end in your high level design. Also you could draw a sequence diagram using the diagramming tool to enhance your explanation...
Dig deeper into 2-3 components and explain in detail how they work. For example, how well does each component scale? Any relevant algorithm or data structure you like to use for a component? Also you could draw a diagram using the diagramming tool to enhance your design...
Explain any trade offs you have made and why you made certain tech choices...
Try to discuss as many failure scenarios/bottlenecks as possible.
What are some future improvements you would make? How would you mitigate the failure scenario(s) you described above?