pythondatabasedaemonpersistent-object-store

Best way to reload daemon state - from saved data in my custom format or a persistent database?


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 ?


Solution

  • 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.