back

by worik·9y ago·view on hn ↗
Exactly.

I start with text files and for most purposes I do not bother with anything else.

Next is a key/value store. Simple.

Relational databases carry large overhead in translating data (as above) and also in design and maintenance of the structure and getting data into and out of them. I spent many years with them, like them a lot, but they are too much complication for most purposes.

Even with relational data RDBMS are only good if you are not certain of how you will be accessing the data. In most cases you are sure.

I am constantly stunned how people reach straight for MySQL or Postgres when flat text files with grep would work just as well and be much quicker to implement

2 comments
I'm stunned that you're stunned that people generally don't use text files as data stores.
How do you deal with concurrent write access, do you lock the file?
He probably uses flock(2)
But isn't that hard to get right? At least if you using something like sqlite you get consistency guarantees.

Consider your process writing to the file and dying during write() - do you recover and repair the file after you reschedule?

Ramdisk maybe?
seriously curious -- what do you do when someone or some other "function" wants to query your data, wants to update it, etc.?