I have a node js app, in which I need to perform background jobs. My plan is to use a data structure which will contain all the jobs needs done. My design also suggests that this data structure needs to persist between application restarts. To achieve that I can think of two options to store the datastructure:
a) use a database
b) use a file
Solutions like external queues might probably be an overkill for my app(the data structure will contain 5 - 10 entries(jobs) at any time).
Currently, I am inclined towards using a log file, which I think will be faster and plus I do not need to query that info(therefore need for a database).
How do you evaluate this approach? Is using a log file for runtime persistence a good practice? Are there any other benefits/drawbacks to it? Is there an alternative I should consider in my scenario?