The topic of combining a database system (usually a conventional relational db system) with a file system to add meta-data, a richer set of attributes to files, has been a recurring discussion item on this and other sites. The article published last week, Rethinking the OS, under the heading “Where Is It Stored?” talks about the ability to locate a file without knowing the exact name or location.
The Basic Idea
While there are many variations, the essential idea is to enhance the number and type of file attributes to enable location and access to files without knowing the exact path. BeOS added B-tree indices for additional attributes (such as author, title, etc.) thus enabling fast searching based on those attributes. WinFS seems to use Microsft’s SQL server (or a version thereof) to store and index file attributes.
Using RDBMS technology to index file attributes enables fast search of files based on a number of attributes besides file name and path. In effect, we enhance access capability by providing many more new access paths that were not available before. At its core, this idea of adding a database to a file system is about adding many more new access mechanisms to files. The increased flexibility enables users to locate files using different terms, especially domain specific terms that have nothing to do with file name and path.
The Arguments Against It
Many developers and other technically-inclined computer users are very much against this idea. However, their opinion is often not based on sufficient information and clarity to be sound. It is easy to jump to conclusions based on headlines alone or a short summary provided by news.
The common criticism is that addition of a database is simply not necessary. After all, the modern file systems do work very well, provide a very fast and efficient access to many files already. Why mess with them? This is the, “If it ain’t broke don’t fix it”, philosophy. This is a perfectly valid argument, as it is well known that the modern file systems are results of a long evolution and therefore have many excellent characteristics. It is important to note, though, that this idea simply adds database to an existing file system and doesn’t eliminate it! The standard file system continues to play the same role as it always has had. It is not being removed of replaced!
Another argument is that the overhead introduced by a database system on top of (or next to) a file system is simply not necessary. There are several problems with this argument. First, the overhead is not very well understood today. This argument may be valid only if the overhead is significant. Naturally all implementations strive to keep the overhead minimal. In the past when computing resources were scarce this argument would make sense. Today with massive processing, memory and hard disk capacities available the overhead should be handled without any problems. In fact, future multicore processors can easily execute database operations on one of the cores in background with little to no impact on other tasks.
Another argument is that database simply adds unnecessary complexity to the filesystem. There are many RDBMS of different sizes and complexities. In general, database systems being combined with file systems are of the smaller, simpler variety. We are not talking about a massive Oracle database using massive amounts of memory and disk space. In general, they would be some sort of smaller embedded database systems that are much lighter on machine resources.
The principal argument against it is that we simply don’t need it. To clarify, we – the readers, programmers, technical users – don’t need it. Of course, there are other users, other perspectives, who may not be well represented here. In particular, the less computer savvy users do, in fact, need it.
An increasing number of people use computers. They both produce and use an increasing number of files. Networking has also caused these files to be scattered across multiple computers, from company file servers to Palm Pilots and iPods. They are not so much interested in the efficient algorithms, overhead of databases and other technical arguments. They are interested in their time wasted trying locate a file. This problem of trying to organize and locate files will only get worse, not better!
These users operate in non-technical domains which don’t include the concept of paths and file names. Every time they must use file manager or file open dialog they must perform a domain switch. Worse yet, most of them lack either the desire or the skill to organize the files well. How many times have you seen a novice computer user with a desktop cluttered with file icons? Often they don’t even know or understand directories. My father panicked when a file dropped off the recently used list in Word. He simply never used file manager.
Full file path is simply a unique key to a file, necessary to be able to reference files without any ambiguity. They serve the same role as a primary key in database systems. There are other system related attributes (few timestamps, ACLs, etc.) but no other domain specific attributes. Databases can store and handle many more attributes, so it is simple to add many more attributes that are domain specific. Besides the usual author, title, and similar, doctor’s office can add health related attributes, or lawyer’s office could add law domain attributes, etc.
In fact, there is no reason why any one attribute type should be the dominant one. File name should be only one of many equal attributes. Thus a GUI such as file manager should enable users to browse using other attributes. For instance, it could display a hierarchy where the 1st level are authors and second are titles. In fact, there are many different combinations possible. That is another article.
Offering the ability to define additional domain attributes and manage them (store, search,…) at the OS level removes the burden from applications. In addition, it offers the possibility of standardized, application-agnostic mechanisms to access file attributes. Compare it to the current situation where searching for information across many different file types, binary formats, is extremely difficult and painful.
Programmers are inclined and able to develop all sorts of tools to organize their files. We simply solve our problems by creating new tools. The wider user community cannot do this. They need help. From their perspective the problem of managing a large number of files is real and here today. Therefore we should move past the question if it is necessary and examine the best design/implementation solutions.
Also see: For a sample file manager based on these and other ideas see Dekk