4 ms·
> It's helpful architecturally to have a distinction between on-disk structures (which you're careful about either not changing or migrating) and in-memory stru
by vanviegen 5y ago
> It's helpful architecturally to have a distinction between on-disk structures (which you're careful about either not changing or migrating) and in-memory structures (which don't) rather than trying to freeze or migrate everything.
That's true, but syncing between the database and in memory data structures is tedious. Imagine building an application and never having to worry about storage. Just instantiate and reference objects and you're set. When working with lots of data, the OS would just swap things in on demand. That would save a lot of development time for many types of applications.
But yes, there would be some big challenges regarding application updates and how not to destroy all data with a trivial bug. (A misplaced `customers = []` might be all it takes to permanently wipe all data. Perhaps this idea should be combined with immutable data structures and versioning.)
[Edit] After some more consideration: what I'm talking about feels more like a language feature than something the operating system can/should do.
- skybrian 5y agoSerialization doesn't go away because you still need it for network connections. Data formats useful for sending messages over the network can also be useful for saving things to disk. These formats should be OS and language-independent and have rules for backward compatibility. Consider how hard it would be to replicate a git repository if it's just a bunch of ad-hoc classes defined in one language. Protobufs are one design that addresses these concerns. There are others. There is an impedence mismatch, but maybe this would be better addressed through languages that have better support for serialization?