3 ms·
How can you store program state on disk like that? You'd need serialization and deserialization. A DB might be easier.
by xupybd 3y ago
How can you store program state on disk like that? You'd need serialization and deserialization. A DB might be easier.
- dmingod666 3y agoYou have things like rocksdb, SQLite etc that are simple have serialization-deserialization built-in, so no external app dependencies
- p886 3y agoMaybe a bunch of JSON files on the local file system? Find the files and read the contents as needed.
- lylejantzi3rd 3y ago> 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.
- mjr00 3y ago> 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.
- aruss 3y agoDunning-Kruger begs to differ...
- xupybd 3y agoYeah, 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.
- CM30 3y agoMy 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.