Frage

I have a infinite process running and end of each day it basically writes to a file and populates internal objects with the updated data.

It's running on Ubuntu and written in Python.

Kindly advice what would be the best approach to restore the data if the process crashes/restarted etc.

Should I read all the files generated so far and update the newly created object so that it has all backed up information available, or should the data kept in a DB kind of thing ?

War es hilfreich?

Lösung

I find shelve module is ideal for state - it gives a nicer api and a little more than a straight pickle - ideal for when a (traditional) database seems like overkill.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top