Comment

Comment by tlb

I've done the flatfile thing several times on various projects, and I'm starting to appreciate the wisdom of letting sqlite handle it. Things it can handle correctly include:

- crashes/power failures

- multiple processes opening the same file

- transactional updates: it rolls back if you throw an exception in the middle of writing the update. This seems like a common failure mode while under development

- scaling to huge size: many gigabytes are no problem. These get slow with a flatfile

- manual surgery on data: it comes with handy command line tools for manipulating its databases

- upgrading format: you can check a version number when opening the file and do "alter table add column" for any new features.

parent tlb 5 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton