Reiser4 and kernel inclusion
Posted Sep 23, 2005 12:32 UTC (Fri) by NAR
In reply to: Reiser4 and kernel inclusion
Parent article: Reiser4 and kernel inclusion
How many times did Edison try to build a lightbulb?
Your analogy is wrong: "database in a file" is not a question of "can be done" or "can't be done". It has been done already at least 20 years ago and there are at least two implementations (VMS filesystem and Berkley DB), so there's nothing new with that. The real question is that should this be implemented in the kernel or in user space.
As I mentioned, the VMS filesystem has a feature like this. One of the recurring problem was that users backuped their MAIL.MAI files (the equivalent to /var/mail/<username>) via FTP to an another computer. Then when they restored the file, they saw that they lost their mail, because this MAIL.MAI file is a "database in file" and its structure is stored in the filesystem, in attributes. Of course, when the file was restored via FTP, the FTP server had no idea that this file should have any special attributes, so the file was created as a binary stream, instead of the special indexed format.
The UNIX filesystem has been designed and used for 35 years with the basic concept that a file is just a sequence of bytes. I'm afraid there are a lot of applications that depend on this fact implicitly and we could be in for some nasty surprises like the above mentioned scenario if this assumption is changed. My other problem with the "database in file" concept has been addressed elsewhere in this thread - code of this complexity shall be done in user space, not kernel space. It's easier to debug and if it crashes, it doesn't bring down the whole computer.
to post comments)