in reply to Append to a busy flat-file db without leaving customer in lurch
Seconding the RDBMS recommendations, but if your heart's set on flat files and you can swing it you might look at a scheme akin to the way maildir does things.