|
|
|
Ask HN: NoSQL or flat files?
|
|
8 points
by mcartyem
4803 days ago
|
|
I suspect a lot of companies use complicated tech for no reason. When using a database, even with the simpler case of not needing table joins at all, people shard databases and use caching on the front-end machines. This complicates their design, with a recent example being the blog post about Pinterest. What does that offer that flat files on a shared filesystem don't? |
|
- 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.