![]() |
![]() |
![]() |
![]() |
![]() |
BDBFS is a portable, user-level NFS fileserver. It implements version 3 of the NFS protocol as defined in RFC 1813.
BDBFS stands for Berkeley DataBase File System. BDBFS is implemented in OCaml (release 3.06) and can be compiled either to native code or bytecodes for the OCaml virtual machine. BDBFS stores files, metadata (directories, inodes, the superblock) as key:value pairs using the Berkeley Database (Berkeley DB) library. Berkeley DB is maintained and supported by Sleepycat Software.
BDBFS uses the OCaml equeue package to implement event queues. Ocamlrpcgen generates OCaml stubs from NFS3 and MOUNT XDR. The OCaml RPC package marshals and unmarshals RPC arguments.
Why build a filesystem on top of a database?
1. All operations are transaction protected. The filesystem operations need not
take the extreme care of ordering updates that characterizes raw-disk-substrate
filesystems and is responsible for much of their complexity and fragility.
2. Fast, fine-grained recovery and arbitrary time travel (into the past-- as always, compute on the POSIX FS interface to move into a future state). No need for a fsck
(traditional FFS approach to recovery) or explicit hooks to write records to
a journal (journaling approach).
3. Concurrency. The transaction subsystem controls concurrent access. No need
for locking within the filesystem operations. Locking is handled by the substrate.
Parallel NFS3 servers can access the same filesystem with concurrency controlled
by the BDB library.
The BDBDS NFS3 code and OCaml Berkeley-DB interface are released under version 2 of the GNU public license. The Berkeley-DB release that ships with it is released under its own license. See the source tree for the text of the licenses. Berkeley-DB and the BDBFS and OCaml BDB interface code are separate systems and their licenses don't interfere. Berkeley-DB is merely bundled in for your convenience.
Build and installation instructions are in the INSTALL file at the root of the source hierarchy. The current release is 0.3. It ships with the no-crypto release of version 4.1.24 of BDB.
release 0.3 bzip2 compressed tar (2.4MB)
release 0.3 gzip compressed tar (3.2MB)