문제

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 ?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top