Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

How can you store program state on disk like that? You'd need serialization and deserialization. A DB might be easier.


> How can you store program state on disk like that? You'd need serialization and deserialization.

You need serialization and deserialization when interacting with a DB, too. You're trusting a library to do most of that for you. This is the difference between a junior engineer and a senior engineer. As a junior engineer, you don't trust your own judgement and use a library. As a senior engineer, you don't trust the library writer's judgement, so you write it yourself.


> As a junior engineer, you don't trust your own judgement and use a library. As a senior engineer, you don't trust the library writer's judgement, so you write it yourself.

What? No. As a senior engineer you realize that loading data from a database is a solved problem, has nothing to do with the core use cases you're addressing, and would be a massive waste of time to build yourself.


Yeah, this is true but I tend to hand craft my persistence to a database. I'm not sure how using files would be any easier. I'd have to manage a bunch of files on top of what I'm already doing.


Dunning-Kruger begs to differ...


You have things like rocksdb, SQLite etc that are simple have serialization-deserialization built-in, so no external app dependencies


My first thought was the way early 1990s forum and blog scripts did it, aka the UBB/Movable Type method of storing everything as static text files in a directory somewhere.

That would be really inefficient though. I vaguely recall database driven blog and forum scripts taking over because of how poorly the old solution worked at scale.


Maybe a bunch of JSON files on the local file system? Find the files and read the contents as needed.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: