mafintosh / flat-file-db

Fast in-process flat file database that caches all data in memory
196 stars 15 forks source link

Call fsync to be truly "fully persisted" #2

Closed roncohen closed 10 years ago

roncohen commented 10 years ago

There should probably be a way to turn fsync on/off (currently always off). Without calling fsync, the data can be in a write cache and not reach the filesystem.

It's a correctness/performance tradeoff that you could let the user make.

mafintosh commented 10 years ago

Thanks for posting this! fsync is always enabled now. To disable it use flatfile(path, {fsync:false}.

mafintosh commented 10 years ago

Released as 0.1.2