On 6/1/2017 2:53 AM, Vladimir Panteleev wrote:
3. Design your program so that it can be terminated at any point without
resulting in data corruption. I don't know if Vibe.d can satisfy this
constraint, but e.g. the ae.net.http.server workflow is to build/send the entire
response atomically, meaning that the Content-Length will always be populated.
Wrap your database updates in transactions. Use the "write to temporary file
then rename over the original file" pattern when updating files. Etc.
This is the best advice.
I.e. design with the assumption that failure will occur, rather than fruitlessly
trying to prevent all failure.