vendredi 12 mars 2021

Does making a database for this usecase make sense?

So I run my code on a weekly basis. Lets say it's 100 new tasks. Each task works on new data for that week.

I want to have a failsafe in case something happens like my computer randomly shuts off or I lose internet connection 30/100 tasks in.

So my idea was to have the database essentially load in the 100 tasks along with that weeks data into a table at the beginning as like a temporary todo list table, then remove them as I go one by one. So if it fails at task 30 out of 100, then next week, I'll have the other 70 still on my todo list plus the new 100.

Does this make sense as a design pattern? The table will essentially be empty 99% of the time. We also already use Postgres so I was thinking of just using that which I guess feels even worse since it offers so much and I'm using it for such a simple reason.

Do "state machines" fit anywhere here? It was suggested to me by someone and I don't really see how it would help after Googling it.

Aucun commentaire:

Enregistrer un commentaire