Hacker News new | ask | show | jobs
by utx00 6309 days ago
might using a berkdb (as suggested) make more sense for your case? it can be devilish tricky getting these things to work right.
1 comments

Possibly. The ability to view/tweak the file in a text editor is something I find very convenient, but it's less important than consistency.
You can always write a wrapper to start a transaction, extract the file from the database, exec $EDITOR on it, replace the database data with the file, and commit the transaction. That is very safe, and very easy to do. (And, you can make the txn apply to multiple files, which is quite useful.)

We use this technique in the command line utility for KiokuDB.