Libsqlfs: A POSIX-style file system on top of an SQLite database
github.com
github.com
There's something to be said for this. Your files get ACID properties. If we were serious about file integrity, we'd have file systems that worked like this:
- Unit files. The unit of data is the entire file. Files are written once, and when closed successfully, the file transaction commits and others can read the file. Any update replaces the entire file as an atomic operation. (Many applications need this, and try to do it with various move and rename operations, usually leaving files behind if things fail at the wrong moment.)
- Log files. You can only add at the end. Writes are atomic. In the event of a crash, the file is valid up to some recently completed write. (On many systems, log files can tail off into junk or contain truncated records.)
- Temporary files. When the process or process group exits, they're gone. Random access is OK. (You shouldn't have to clean up junk temporary files.)
- Managed files. These support a database or something with complex structure. There are extra I/O functions for locking, flushing and being sure a write has been committed to disk.
That covers most of the use cases for files. There have been file systems which did some of this, but not in recent years.
I wonder if this has anything to do with when PalmOS got a 'filesystem' even though the OS originally only gave programs a database to interface with, way back when...
[1] http://how-to.wikia.com/wiki/Howto_replace_microdrive_with_c...
Audience: Then what is the difference between a DB and a filesystem?
Reiser: Marketing.
ps: I always found the IBM/COBOL record oriented FS a good idea. You remove a lot of ad-hoc parsing code from loading and writing data.
At least on Linux.
More obvious is that the database as a whole is dynamically sized.
BabuDB (related to extreemfs.org): http://dl.acm.org/citation.cfm?id=1849822
Spyglass: http://www.ssrc.ucsc.edu/pub/leung09-fast.html
And more from the same researchers: "Scalable File System Indexing": http://www.ssrc.ucsc.edu/proj/fsindexing.html
Perhaps I'm thinking of reiser4?
See also:
TokuFS: https://www.usenix.org/conference/hotstorage12/workshop-prog... https://github.com/esmet/tokufs
I'm still certain I've seen talk of indexing metadata, and I thought it was in an actual, open, system...
This reminded me of BFS: https://en.wikipedia.org/wiki/Be_File_System
An index can be anywhere, and the data you want to keep is somewhat arbitrary - so why not just use a file on the filesystem anyway?
There's also an important difference: metadata indices can be considered disposable in a lot of cases. File data isn't which means the constraints are different: with metadata you want to pack it all into the tiniest, most local part of the disk you can.
With file-data (and the actual filesystem) you want to distribute and replicate that data as widely as possible to minimize the chances that a cluster of failures wipes out important structures.
Indexing on other meta-data, like tags for images and music files -- can be considered a filesystem level problem -- if one considers approaches like Mac (or Amiga) resource forks/info-files.
Perhaps I should have stated "file metadata" as opposed to "just" metadata... One could of course claim that the only thing the filesystem does is take an exact path, and return the data at that path. In such a case, you could replace the path+name with a guiid, and store the filename and path-name info in a file... and update file whenever you accessed a file... and then you end up building some of that into the filesystem interface. So the question really is where the filesystem ends and the "system" starts...
The VFS allows bundling up an app as a self-contained executable (a "starpak") or runnable with the Tcl/Tk interpreter (aka "tclkit"). FS access is transparent to the app--read/write operations are the same for all FS types.
Some work has been done to use sqlite as a VFS data storage medium. I haven't yet tried it myself, but in principle, it's not too hard to accomplish. I'm putting that project on my list...
Out of curiosity, when/why would someone want to use something like this?
SQLite is a file database, in that the database is literally a file, which means it will reside on another already existing filesystem - so you would have:
`
Abstract Filesystem
-------------------
SQLiteDB
------------------- OS FilesystemWould be useful where you have legacy codebase and want to deploy it new scenarios where POSIX filesystem access is not guaranteed.
So, from an UX standpoint, they still make a lot of sense to distribute application bundles since it compels users to "install" the application by dragging the bundle icon to the appropriate directory, which is conveniently symlinked in that Finder window. It's also easier to produce than a self-installing package.
With a .zip or .tar.gz users would be left with an app bundle and no idea of where to put it. Generally they would just throw it somewhere random across the filesystem. At least, that's what non-technical Mac users I know happen to do.
[1]: https://support.cdn.mozilla.net/media/uploads/gallery/images...
And the problem I have with CbFS is it's fairly expensive for a hobbyist like me to consider developing a file system on top of it. :-/
I wish there were a good, free FUSE for Windows.