Skip to content

imjching/sql-fs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sql-fs

POSIX-style filesystem on top of a SQL database using FUSE. At the moment, this filesystem only supports CockroachDB. This is a proof of concept and has limitations. See Future Work below.

Details

This project uses bazil.org/fuse, which is a Go library for writing FUSE userspace filesystems. Bazil implements the kernel-userspace communication protocol.

sql-fs will communicate with the kernel through Bazil to register the mount/ mountpoint as a filesystem. The kernel will forward all filesystem operations for that filesystem back to the sql-fs process through the communication channel established.

Dependencies

  1. CockroachDB
  2. FUSE kernel driver and libraries:
  3. Go.

Usage

Assuming that CockroachDB is listening on port 26257, here are the steps to run sql-fs:

# Clone the sql-fs git repository
git clone [email protected]:imjching/sql-fs.git
cd sql-fs

# Run schema.sql
cockroach sql --insecure < schema.sql

# Build the binary and start the filesystem
make run

# Your mountpoint will be ./mount

Future Work

  1. Support for multiple databases (MySQL, PostgreSQL, etc.) with abstraction.
  2. Concurrent file access. The current implementation for writing and reading is a little fragile.
  3. Tests.

References

About

POSIX-style filesystem on top of a SQL database using FUSE

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published