Skip to content

Repository files navigation

This library implements a FUSE filesystem that uses event sourcing to store data. This approach provides visibility into filesystem changes and allows restoring the filesystem to any previous point. In particular this library supports branching from specific points in the event history (see examples).

Example

use std::{fs, path::PathBuf};use eventfs::{EventPageLimit,Filesystem,FilesystemConfiguration};fnmain() -> Result<(),Box<dyn std::error::Error>>{// Create the local mount point used by FUSE.let mount_point = PathBuf::from("eventfs.mount");
fs::create_dir_all(&mount_point)?;// Open the filesystem and mount it in the background.let configuration = FilesystemConfiguration::new("eventfs.db", mount_point.clone())?;let filesystem = Filesystem::open(configuration)?;let _ = filesystem.spawn_mount()?;// Write a file through the mounted filesystem.
fs::write(mount_point.join("hello.txt"),"Hello from eventfs!")?;// Print the events created by filesystem changes.for event in filesystem.events(EventPageLimit::new(10)?){println!("{:?}", event?);}Ok(())}

FUSE operation support

  • lookup
  • getattr
  • setattr
  • readlink
  • mknod
  • mkdir
  • unlink
  • rmdir
  • symlink
  • rename
  • link
  • open
  • read
  • write
  • flush
  • release
  • fsync
  • opendir
  • readdir
  • releasedir
  • fsyncdir
  • statfs
  • setxattr
  • getxattr
  • listxattr
  • removexattr
  • access
  • create
  • readdirplus
  • getlk
  • setlk
  • bmap
  • ioctl
  • poll
  • fallocate
  • lseek
  • copy_file_range

Benchmarks

  • Measured with ./dev.sh bench on July 9, 2026.
  • Apple M4 Pro host, macOS 26.2 25C56.
  • Apple container Linux VM, Linux 6.18.15 aarch64.
  • 14 CPUs and 49.3 GB RAM exposed to the container.
  • FUSE 3.14.0.
BenchmarkHosteventfsOverhead
Read metadata by path215 ns226 ns1.1x
Read metadata from an open file128 ns128 ns1.0x
Change file permissions280 ns38.91 µs139.2x
Resize a file between 2 KiB and 4 KiB523 ns62.03 µs118.6x
Check file read access198 ns211 ns1.1x
Read filesystem statistics282 ns23.71 µs83.9x
Create a named pipe772 ns81.73 µs105.9x
Create a directory51.42 µs82.45 µs1.6x
Create a file886 ns87.43 µs98.7x
Delete a file1.008 µs67.49 µs66.9x
Remove an empty directory1.307 µs66.4 µs50.8x
Rename a file874 ns84.57 µs96.8x
Rename a file without replacing the destination885 ns84.26 µs95.3x
Create a hard link576 ns84.61 µs146.8x
Create a symbolic link830 ns84.34 µs101.6x
Read a symbolic link target247 ns22.44 µs90.7x
Open a file253 ns24.1 µs95.4x
Read 4 KiB201 ns27.67 µs137.4x
Overwrite 4 KiB241 ns56.77 µs235.6x
Flush a file104 ns106 ns1.0x
Close a file156 ns2.699 µs17.3x
Synchronize a file27.35 µs54.79 µs2.0x
Open a directory containing 16 files392 ns25.57 µs65.2x
Read a directory containing 16 files538 ns51.12 µs95.1x
Read a directory and metadata for its 16 files4.353 µs108.4 µs24.9x
Synchronize a directory26.36 µs53.42 µs2.0x
Close a directory158 ns2.624 µs16.7x
Set a 5-byte extended attribute370 ns56.76 µs153.5x
Read a 5-byte extended attribute292 ns23.13 µs79.2x
List extended attributes261 ns24.28 µs93.0x
Remove an extended attribute364 ns56.21 µs154.4x
Write a new 256 MiB file sequentially32.5 ms407.1 ms12.5x
Write the first 64 MiB of a new file7.471 ms95.7 ms12.8x
Append 64 MiB to a 192 MiB file6.538 ms97.66 ms14.9x
Overwrite the middle 64 MiB of a 256 MiB file3.694 ms133.8 ms36.2x
Write 64 MiB at a 512 MiB offset in a sparse file6.929 ms96.24 ms13.9x
Truncate a 256 MiB file to 128 MiB, then extend it to 320 MiB4.629 ms61.8 ms13.4x
Write and synchronize a new 256 MiB file194.7 ms407 ms2.1x
Write, synchronize, and rename a 256 MiB file510.1 ms403.8 ms0.8x

About

Event sourced FUSE filesystem.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages