NixOS / nix

Nix, the purely functional package manager
https://nixos.org/
GNU Lesser General Public License v2.1
12.27k stars 1.48k forks source link

Investigate using FUSE #10742

Open Ericson2314 opened 4 months ago

Ericson2314 commented 4 months ago

A lot of complexity in the LocalStore implementation has to do with the fact that the file system and database are two sources of truth, and the file system doesn't directly track what Nix cares about, but rather has to be mutated to reflect the ramifications of that actual state of the store. (Not sure how better to phrase this -- the idea is that the file system state is one step removed from the source of truth.)

FUSE has the potential to allow us to change our architecture quite dramatically: because all filesystem operations would go through Nix, instead of worrying about the "other state" or "other access patterns" not directly in our control, we would control everything.

Historically, FUSE has been unreasonably slow to be used for much more than toys, but recently that is starting to change with "FUSE passthrough (see e.g. https://www.phoronix.com/news/Linux-6.9-FUSE-Passthrough, https://lwn.net/Articles/932060/). This allows userspace to make "control plane" decision while most "data plane" action still happens within the kernel with much higher performance. This, and perhaps further work (the FUSE passthrough author once told me on the mailing list not to get too excited :)), should make a FUSE rearchitecture much more viable an option.

abathur commented 4 months ago

Tangentially related? https://github.com/dnr/styx