sapling/eden/fs/docs/Overview.md
Adam Simpkins 145320fe96 check in some high-level design documentation for EdenFS
Summary:
This checks in some design documents based on the "EdenFS Internals"
presentation that I've given internally a few times.

Reviewed By: wez

Differential Revision: D21519530

fbshipit-source-id: 3f79d38e8ccf994b2ef303d491809a91fa5b6d95
2020-05-15 18:08:47 -07:00

3.1 KiB

EdenFS Overview

EdenFS is a virtual filesystem designed for efficiently serving large source control repositories.

In particular, EdenFS is targeted at massive monorepos, where a single repository may contain numerous projects, potentially spanning many millions of files in total. In most situations individual developers may only need to interact with a fraction of the files in the repository when working on their specific projects. EdenFS speeds up workflows in this case by lazily fetching file data, so that it only needs to fetch file information for portions of the repository that are actually used.

EdenFS aims to speed up several different types of operations:

  • Determining files modified from the current source control state. (e.g., computing the output for hg status or git status)
  • Switching the filesystem state from one commit to another. (e.g., performing an hg checkout or git checkout operation).
  • Tracking and delivering notifications about modified files. EdenFS can deliver notifications of file changes events through Watchman, to allow downstream tools like build tools and IDEs to build functionality that depends on file notification events.

Additionally, EdenFS also provides several additional features like efficiently returning file content hashes. This allows downstream build tools to retrieve file hashes without actually needing to read and hash the file contents.

Operating System Interface

EdenFS is supported on Linux, macOS, and Windows. The mechanism used to interact with the filesystem layer is different across these three different platforms.

On Linux, EdenFS is implemented uses FUSE to provide filesystem functionality. On macOS EdenFS uses FUSE for macOS, which behaves very similarly to Linux FUSE.

On Windows EdenFS uses Microsoft's Projected File System. This behaves fairly differently from FUSE, but EdenFS still shares most of the same internal logic for tracking file state.

Parts of the design discussion that follow focus primarily on the Linux and macOS implementations. On Windows the interface to the OS behaves a bit differently, but internally EdenFS still tracks its state using the same inode structure that is used on Linux and macOS.

High-Level Design

The following documents describe the design of relatively high-level aspects of EdenFS's behavior:

Design Specifics

The following documents cover specific features and implementation details in more depth: