3 ms·
Why is it called "immutable" iso "persistent"? https://en.wikipedia.org/wiki/Persistent_data_structure https://en.wikipedia.org/wiki/Persistent_data_structure
by toolslive 6y ago
Why is it called "immutable" iso "persistent"?
https://en.wikipedia.org/wiki/Persistent_data_structure https://en.wikipedia.org/wiki/Persistent_data_structure
- convolvatron 6y agonothing is ever deleted in an immutable store. a persistent store survives across reboots, but you can delete elements if you can deal with the consequences, removing deletes makes dealing with concurrency a lot easier
- TheColorYellow 6y agoTo me the usage of "immutable" is to imply some element of verifiably provable data exists in the database or system. Persistence would rather imply data longevity in the face of disaster, downtime, or under load, etc. Not the greatest use of terms but that's how I view it.
- toolslive 6y ago"a persistent data structure is a data structure that always preserves the previous version of itself when it is modified. Such data structures are effectively immutable, as their operations do not (visibly) update the structure in-place, but instead always yield a new updated structure. The term was introduced in Driscoll, Sarnak, Sleator, and Tarjans' 1986 article". It's effectively the same thing. A third name for the same thing is "append only".
- kreetx 6y agoIn databases I think what they mean with persistence is writing to disk, i.e committing to the new state. Immutable on the other hand appears to mean a similar thing both in databases and data structures.
- amelius 6y agoWould such a database be practical when dealing with laws like GDPR where you have to actually delete stuff sometimes?
- jacobobryant 6y agoCould be an issue. For that reason, the two immutable databases with which I'm familiar (Crux and Datomic[1]) provide operations for removing bits of data from history. [1]on-prem, not cloud However even if the DB doesn't offer that operation, you could use "crypto shredding" where you encrypt the data before putting it in the immutable db and then store the key in some kind of mutable store. (Then delete the key when you want to delete its corresponding data). There's also this post which describes some other methods of making a Datomic cloud system gdpr compliant: https://vvvvalvalval.github.io/posts/2018-05-01-making-a-datomic-system-gdpr-compliant.html https://vvvvalvalval.github.io/posts/2018-05-01-making-a-dat...
- deleted 6y ago[deleted]
- skrebbel 6y agoI'd wager that in most programming ecosystems (the non-FP ones in particular), "persistent" means "sticks around after a crash/restart/etc", i.e. in practice, that it's saved to disk. Sure, some academics used the term for a class of in-memory data structures too, and it got taken over in some programming circles, but it's a niche term at best. Now, so far so good, but using that term for databases might be maximally confusing. After all, isn't a database's primary purpose to persist data? Then, aren't all databases persistent? Oh, no, the author meant that other meaning of "persistent" that many people aren't familiar with. I think the author made the right call :-) (I know that immutable and persistent aren't the same thing: you can make an immutable data structure that isn't persistent in that it doesn't reuse data - but it's the best we got)