3 ms·
That's a trite observation that doesn't actually _say_ anything. But formulated in that language, my comment becomes: POSIX picks less than useful trade-offs f
by eru 3y ago
That's a trite observation that doesn't actually _say_ anything.
But formulated in that language, my comment becomes: POSIX picks less than useful trade-offs for distributed file systems.
An extreme example: POSIX's atime gives you something you seldom need, but imposes a huge burden. That's such a bad trade-off, that approximately no-one implements the original spec, even if nothing is distributed at all.
- labster 3y agoIt’s not a bad idea, atime, just that our hardware never developed any tech where writes are as cheap as reads. Or even close. I wonder if that’s theoretically possible.
- eru 3y agoWhen they were coming up with 'atime' and thought it was a good idea, it was because with their tech writes were about as cheap as reads.
- yjftsjthsd-h 3y ago> just that our hardware never developed any tech where writes are as cheap as reads. Or even close. I wonder if that’s theoretically possible. I had it in my head that modern flash actually does read in a way that involves writing, and we just paper over that for the sake of the abstractions we use. Am I wildly misremembering?
- jlokier 3y agoYou might be thinking of DRAM, which does work that way. Reads discharge the memory array capacitance so the data has to be amplified and rewritten.
- bravetraveler 3y agoAs far as I know, reads are reads. Though, writes aren't quite so simple Sometimes blocks may have to be read and re-written elsewhere to make room... and this is what makes using TRIM and having cache on-disk so important.
- yjftsjthsd-h 3y agoOh, I might have gotten it backwards; writes actually involving reads could make sense.
- AtlasBarfed 3y agoTrite? He basically stated the CAP theorem. It's been proven mathematically. Essentially if you distribute your data, you have to choose some degree of consistency versus availability.
- remram 3y agoThe CAP theorem says you can satisfy two of C,A,P, not that "it's impossible to reliably satisfy anything".
- eru 3y agoAnd the CAP theorem only has a small relationship with why POSIX is bad for filesystems.
- AtlasBarfed 3y agoThe path to really big distributed datastores go through the CAP theorem. I'm not fully familiar with POSIX requirements for filesystems, but having atomic changes and good performance and a host of other aspects to keep the illusion of available and consistent files in a distributed store runs right through the CAP theorem.
- eru 3y agoThe problem isn't so much requiring atomic changes at all, but what kind of changes are required to be atomic, and which changes are not atomic. The POSIX tradeoffs are just horrible here. As an example of how to do better, squint a bit and have a look at git interpreted as (part of) a distributed data store. Git doesn't pretend that you can make a change in one location, and have it atomically show up in all locations. On the other hand, Git does allow you to make changes to multiple files, and only have them show up together or not at all. Git also has explicit mechanisms for resolving conflicts when multiple people tried to make changes to the same files. Git doesn't get around the CAP theorem; it just has much better trade-offs than POSIX, because Git was designed explicitly for distributed use. POSIX also doesn't allow you to have different trade-offs for read-only and read-write data.