Hacker News new | ask | show | jobs
by UnoriginalGuy 4804 days ago
- Concurrency (of access to records)

- Performance (e.g. caching, indexing, etc)

- Less first party code means less development/debugging/design time, with benefits growing very quickly the larger a project becomes

- Queries are more flexible than APIs (and add a clear isolation between data source-logic and data usage-logic)

- Scalability; flat files don't have it.

The only benefit of flat files is as a learning exercise. It is useful to understand how to make a database-like system yourself so you can understand how things can go wrong and certain edge cases.

But in production code I'm yet to see any situation where a homegrown flat file system was better in the long run than an off-the-shelf database solution. I have seen several flat file systems that have made it impossible for companies to scale and have likely cost them millions in lost revenue as a direct result, so that is fun too.