Meta Sapling Mononoke Comparison
Take a look at meta's sappling, mononoke, and how they differ from github. Explain it to me Meta has built something quite interesting with Sapling, Mononoke, and EdenFS. Together, they're effectively an alternative t…
Human participant
Take a look at meta's sappling, mononoke, and how they differ from github. Explain it to me
Language model
Meta has built something quite interesting with Sapling, Mononoke, and EdenFS. Together, they're effectively an alternative to the conventional Git + GitHub architecture, designed to operate at a scale where traditional Git workflows become painful.
The important distinction is that Sapling is an alternative to Git, while Mononoke is closer to an alternative to GitHub's repository storage and serving infrastructure. But Meta has also made some fundamentally different architectural decisions.
1. Understanding the three components
<box border radius="xl" padding={3} gap={2}> <svg viewBox="0 0 340 244" width="100%" xmlns="http://www.w3.org/2000/svg"> {#each [{x:15,label:"Conventional Git / GitHub",sub:"Developer",client:"Git CLI",store:"Local .git + files",server:"GitHub",desc:"Git repository hosting"},{x:177,label:"Meta's architecture",sub:"Developer",client:"Sapling (sl)",store:"EdenFS",server:"Mononoke",desc:"Distributed source server"}] as c} <text x={c.x+73} y="16" fontSize="10" fontWeight="600" textAnchor="middle" fill="currentColor">{c.label}</text> <rect x={c.x} y="30" width="146" height="41" rx="7" fill="#64748b" fillOpacity=".13" stroke="#94a3b8"/> <text x={c.x+73} y="46" textAnchor="middle" fontSize="11" fontWeight="600" fill="currentColor">{c.client}</text> <text x={c.x+73} y="60" textAnchor="middle" fontSize="9" fill="currentColor">Source control client</text> <path d={`M${c.x+73} 71 V91`} stroke="#64748b" strokeWidth="1.5"/> <path d={`M${c.x+69} 86 L${c.x+73} 92 L${c.x+77} 86`} fill="none" stroke="#64748b" strokeWidth="1.5"/> <rect x={c.x} y="94" width="146" height="41" rx="7" fill="#64748b" fillOpacity=".13" stroke="#94a3b8"/> <text x={c.x+73} y="111" textAnchor="middle" fontSize="11" fontWeight="600" fill="currentColor">{c.store}</text> <text x={c.x+73} y="125" textAnchor="middle" fontSize="9" fill="currentColor">{c.x===15?"Full working checkout":"On-demand file checkout"}</text> <path d={`M${c.x+73} 135 V164`} stroke="#64748b" strokeWidth="1.5" strokeDasharray="4 3"/> <path d={`M${c.x+69} 158 L${c.x+73} 165 L${c.x+77} 158`} fill="none" stroke="#64748b" strokeWidth="1.5"/> <rect x={c.x} y="167" width="146" height="48" rx="7" fill={c.x===15?"#64748b":"#0d9488"} fillOpacity=".15" stroke={c.x===15?"#94a3b8":"#0d9488"}/> <text x={c.x+73} y="186" textAnchor="middle" fontSize="12" fontWeight="600" fill="currentColor">{c.server}</text> <text x={c.x+73} y="201" textAnchor="middle" fontSize="9" fill="currentColor">{c.desc}</text> {/each} <text x="170" y="236" textAnchor="middle" fontSize="9" fill="currentColor" opacity=".7">Simplified conceptual comparison</text> </svg> </box>Sapling — the developer interface
<text color="secondary" size="xs">Rough equivalent: Git CLI</text>
Sapling is a version control client originally derived from Mercurial, but compatible with Git repositories.
It supports the operations you'd expect: commits, rebases, branches, diffs, and pushing code.
Its biggest usability improvement is treating stacks of commits as first-class objects. Instead of juggling branches and manually rebasing chains of pull requests, Sapling makes it easy to manage and visualize a series of dependent changes.
Its Interactive Smartlog interface also provides a visual representation of your work.
Crucially, you can use Sapling with an ordinary GitHub repository. You don't need Mononoke. <Cite refs={["turn333960search3","turn333960search0"]}/>
Mononoke — the source control backend
<text color="secondary" size="xs">Rough equivalent: GitHub's Git hosting backend</text>
Mononoke is the more technically interesting part.
It's a distributed, primarily Rust-based service responsible for:
- Storing commits, file contents, and repository history.
- Managing branches and commit relationships.
- Accepting pushes and serving source code.
- Maintaining indexes and coordinating concurrent writes.
- Supporting multiple version control protocols.
Unlike a conventional Git server, Mononoke doesn't use Git's native object representation as its canonical storage format.
Instead, it uses its own format called Bonsai, from which it can derive Git-compatible representations.
That gives Meta more freedom to optimize storage, indexing, concurrency, and serving independently. <Cite refs={["turn333960search2","turn333960search5"]}/>
EdenFS — the virtual filesystem
<text color="secondary" size="xs">Rough equivalent: Git checkout / working tree</text>
Normally, when you clone a Git repository, Git downloads the repository's objects and materializes the files in your working directory.
For a repository containing tens of millions of files, that's expensive.
EdenFS takes a different approach: it presents a filesystem containing the repository's files but fetches actual contents only when needed.
Imagine a 100 GB repository where you're working on 50 MB of files. EdenFS can avoid materializing the other 99.95 GB.
This is particularly useful for Meta's giant monorepo. <Cite ref="turn333960search10"/>
2. How the architectures actually differ
| Dimension | Git + GitHub | Sapling + Mononoke + EdenFS |
|---|---|---|
| Version control | Git | Sapling, Git-compatible |
| Canonical commit format | Git objects | Bonsai |
| Local repository | Typically substantial local Git object store | Can use remote-backed storage and virtual filesystem |
| Checkout | Materialized files, optional sparse checkout | Lazy file materialization |
| Server architecture | Git hosting plus GitHub services | Distributed, stateless frontends and storage services |
| History manipulation | Branches, rebase, cherry-pick | Emphasis on commit stacks and server-side rebasing |
| Scale target | Broad range of repository sizes | Extremely large monorepos |
| Ecosystem | Enormous | Much smaller |
One caveat: GitHub itself has highly sophisticated distributed infrastructure, including techniques for scaling very large repositories. It would be incorrect to think GitHub simply runs git on a single server.
The architectural difference is more about the canonical data model, the client workflow, and the integration with a purpose-built virtual filesystem.
3. The most interesting technical difference: Bonsai
This is where Mononoke departs substantially from Git.
Git's fundamental objects include blobs, trees, commits, and tags. A commit references a complete root tree representing the repository snapshot.
Mononoke uses a different internal representation:
<box border radius="lg" padding={3} gap={2}> <text weight="medium" size="sm">Mononoke's write and read paths</text> <svg viewBox="0 0 340 220" width="100%"> <rect x="88" y="5" width="164" height="35" rx="7" fill="#64748b" fillOpacity=".13" stroke="#94a3b8"/> <text x="170" y="19" textAnchor="middle" fontSize="11" fill="currentColor" fontWeight="600">Git / Sapling commits</text> <text x="170" y="31" textAnchor="middle" fontSize="9" fill="currentColor">Incoming writes</text> <path d="M170 40 V63" stroke="#64748b" strokeWidth="1.5"/> <path d="M166 57 L170 64 L174 57" fill="none" stroke="#64748b" strokeWidth="1.5"/> <rect x="88" y="65" width="164" height="40" rx="7" fill="#0d9488" fillOpacity=".16" stroke="#0d9488"/> <text x="170" y="82" textAnchor="middle" fontSize="12" fontWeight="600" fill="currentColor">Bonsai</text> <text x="170" y="96" textAnchor="middle" fontSize="9" fill="currentColor">Canonical source of truth</text> <path d="M170 105 V124 H84 V140 M170 124 H256 V140" stroke="#64748b" strokeWidth="1.5" fill="none"/> <rect x="6" y="141" width="155" height="43" rx="7" fill="#64748b" fillOpacity=".13" stroke="#94a3b8"/> <text x="83" y="158" textAnchor="middle" fontSize="11" fontWeight="600" fill="currentColor">Blob storage</text> <text x="83" y="173" textAnchor="middle" fontSize="9" fill="currentColor">Immutable contents</text> <rect x="179" y="141" width="155" height="43" rx="7" fill="#64748b" fillOpacity=".13" stroke="#94a3b8"/> <text x="256" y="158" textAnchor="middle" fontSize="11" fontWeight="600" fill="currentColor">Derived indexes</text> <text x="256" y="173" textAnchor="middle" fontSize="9" fill="currentColor">Trees, Git views, history</text> <text x="170" y="209" textAnchor="middle" fontSize="10" fill="currentColor">Derived data can be computed asynchronously</text> </svg> </box>Mononoke's core storage model records commits as Bonsai changesets and stores file contents as content-addressed blobs.
It then derives additional structures, including manifests and Git-compatible objects.
This is powerful for several reasons.
First, the write path can be very lightweight. When you push a commit, Mononoke doesn't necessarily need to compute every possible index synchronously. It can persist the core data and calculate expensive derived representations asynchronously.
Second, storage can scale horizontally. Mononoke uses external blobstores and metadata databases, rather than depending on one Git repository directory as the authoritative unit of storage.
Third, multiple VCS formats can coexist. Git and Sapling clients can interact with the same canonical repository through protocol-specific interfaces.
This is closer to the architecture of a distributed database than a traditional Git repository server. <Cite ref="turn333960search2"/>
4. Meta's development workflow is also fundamentally different
Meta's source control architecture is closely connected to its development philosophy.
At Meta, a huge number of engineers work in a common monorepo, with a single main branch as the primary integration point.
Rather than having long-lived feature branches diverge from main, the system encourages smaller changes that are continuously rebased and landed.
Mononoke supports a mechanism called pushrebase, where the server coordinates rebasing and landing changes onto the current mainline.
This reduces the coordination problems that arise when thousands of developers are changing one repository simultaneously.
Sapling makes the developer side of this workflow more manageable by emphasizing stacks of changes.
Meta has also developed specialized approaches for versioning parts of the monorepo without branching the entire repository. <Cite refs={["turn333960search9","turn333960search4"]}/>
5. Can you actually replace GitHub with it?
There are two different answers.
<row align="start" gap={3}> <box flex="1" gap={1}> **Sapling client**<badge color="success">Usable today</badge>
You can install Sapling, clone a GitHub repository, and use its improved workflows without changing your existing hosting.
</box>
<box flex="1" gap={1}>
**Mononoke + EdenFS**
<badge>Experimental externally</badge>
The code is open source, but Meta explicitly says these components are not yet supported for public deployment.
</box>
</row>
Also, Mononoke is not a complete GitHub replacement as a product. It doesn't automatically give you GitHub's issues, Actions, organization management, and pull request ecosystem.
Meta has separate tools for some of these concerns, including ReviewStack for stacked code review.
The source code is available at <Link url="https://github.com/facebook/sapling" title="facebook/sapling"/>. <Cite ref="turn333960search8"/>
6. Why I think this architecture is especially interesting for AI coding agents
There's an important potential implication beyond Meta's original design goals.
Git was designed around developers operating on repositories, creating branches, and manipulating history locally.
But imagine an environment with hundreds or thousands of AI coding agents, each working on isolated changes to a common codebase.
The combination of Mononoke and EdenFS suggests a different model:
- Agents receive cheap, virtualized views of a repository instead of repeatedly cloning everything.
- They work in isolated workspaces, potentially with their own commit stacks.
- A centralized service manages the canonical history and coordinates landing changes.
- Expensive indexing and repository operations happen in shared infrastructure rather than being repeated by every agent.
This is an architectural extrapolation, not a claim that Meta designed the system specifically for AI agents.
It could be particularly relevant to Fork's sandbox architecture, where spinning up many independent coding environments and synchronizing their changes may become a significant infrastructure challenge.
My overall assessment: Sapling's usability improvements are nice, but Mononoke's separation of canonical source history from Git's storage representation is the more profound innovation. It suggests that Git compatibility doesn't require Git to remain the underlying storage engine.
And EdenFS adds the other half of the idea: a developer—or agent—doesn't need a fully materialized copy of the repository to work on it.
That combination could become increasingly valuable as the number of simultaneous code-writing agents grows far beyond the number of human developers. <MemoryCite />
If you want, I can:
- Explain how Mononoke's Bonsai format improves Git storage and scaling
- Describe Meta's pushrebase workflow and its advantages for a large monorepo
- Discuss how EdenFS virtualizes file checkout for enormous repositories