| File system is an important part of a modern operating system. It is essential for the file system to be reliable and fast. However, at present, traditional file system is facing many problems, such as exception recovery, low performance in desktop search and so on. On the other hand, databases also have similar tasks, but have better characteristics in data management. New file system based on database techniques tries to bring database techniques to the design of file system, and it has been a research focus.In this paper we make the effort to explore the philosophy of designing a file system based on database techniques. At present, there is no mature theory in this area, so many implementations are often limited to the specific specialized applications. After analyzing the design philosophy of traditional file system, we propound the design pattern and implementation strategies of the file system based on database techniques: kernel mode design pattern and user mode design pattern; Database-based and Database-centric implementation strategies. Based on the idea of macro-kernel and micro-kernel, the kernel mode implements the file system in the kernel, while the user mod implements it outside of the kernel. The database-based strategy builds a file system on top of a database, but the database-centric strategy introjects the both entirely. Together with the database tailorable techniques, we build preliminary theory architecture of the file system based database techniques.We design and implement a prototype file system named XDBFS. For data storage, XDBFS has ported the Berkeley DB into Linux kernel. For metadata storage and extensibility, XDBFS builds six Berkeley DB databases, including lookup.db, metadata.db, block.db, link.db, synlink.db and xattr.db. XDBFS supports standard file system operations, by the implementation of Linux VFS methods. Using the Berkeley DB transactions around its file operations, XDBFS has some ACID properties, which make the solution of traditional file system problems to be possible. The implementation of XDBFS proves the feasibility of our design philosophy, so it is a resultful try of database techniques based file system. XDBFS is a suitable integration of database and file system, and also it is a good transition from traditional file system to the new database techniques based file system. |