Timwi wrote:
That said, thinking about it in a much less practical and much more abstract/general way, I have to wonder why Blobs and files are any different. They are both a linear arrangement of bits. If the mechanics that file systems such as NTFS or ext-2 use were the most efficient known way of handling this data type, certainly databases would make use of it instead of implementing something knowingly less optimal?
I absolutely agree with this thinking. The problem is that neither Microsoft nor Oracle invites me to inspect their source code, and they don't document (to me) what kind of tests their solution has been put to. It's like a dictator that says "you have to trust me", before they blindfold you. I prefer to trust my own eyes.
A similar, totally brain-dead, problem was that Sun's Java runtime environment for a println() was found to make two separate operating system calls to write(2), one for the string argument, and another one for the newline character. If two processes were appending lines to the same log file using println("line"), you would certainly expect that the result would be line1-newline-line2-newline, but sometimes it turned out to be line1-line2-newline-newline, because the way the separate write(2) calls interleaved with eachother. The undesired behaviour disappeared when the application was changed from println("line") to print("line\n"). I don't remember which version of Sun's JRE this was, or if it is still there.
This is where running truss or strace on the application can tell you a lot of the stupid solutions that are hidden in big, complex systems. If the source code is open, you have a chance to fix the problem. Otherwise, you have to code around it. In this perspective, filesystems are less complex than databases, more likely to have been thoroughly tested, and less likely to contain the most stupid bugs.