How Cursor's Continuity Scales Git Storage with an S3 Write-Ahead Log
Hosting Git repositories sounds simple until you try to do it for millions of repositories, thousands of CI jobs and a growing swarm of coding agents. Cursor has now published how it solves this problem with a system called Continuity, which uses a write-ahead log (WAL) in S3 as the single source of truth for every repository.
The design was described in a long engineering post by Cursor engineer Vicent Martí, and InfoQ later summarized it. In this article, we break down what Continuity does, why it differs from the approach most Git hosts use today, and what developers can learn from it.
Why Hosting Git at Scale Is Hard
Git was designed so that every copy of a repository is identical, which means a server copy is no different from the one on your laptop. That sounds like it should make hosting easy, but the way Git stores data creates real scaling problems.
Git stores code and history in packfiles, compact binary files that are also what gets transferred when you push or fetch. Packfiles need to sit on a filesystem for Git to read them, and a plain server with one on-disk copy has a low ceiling for both availability and throughput. To go beyond it, you have three broad options: distribute the filesystem, distribute the packfiles, or distribute Git itself.
Each of the early approaches ran into trouble:
- Distributing individual Git objects looks natural, since objects are keyed by hash. But Git's history is a graph, and you cannot know the next pointer until you fetch the previous one, so every step becomes a network round trip. An attempt to store objects in a distributed hash table at Google worked for normal operations, but
git cloneperformance was bad enough that the design was dropped. - Distributed filesystems were tried in GitHub's early years, including NFS, GFS and DRBD. They were slow, buggy or painful to operate, because object layout inside a packfile has little relationship to the graph structure, so reads jump around on disk.
How GitHub's Spokes Approach Works
The model that most Git hosts follow today comes from GitHub's Spokes system, developed around 2013. It makes three choices that Cursor says have held up well: it replicates at the packfile level instead of distributing Git itself, it stores real Git repositories on local NVMe disks, and it keeps all replicas consistently in sync.
A Git push has two parts: a packfile with the new objects, and a reference transaction that updates a branch to point at the new commits. Spokes copies the packfile to every replica, then uses three-phase commit (3PC) on the small reference transaction, so a push is accepted only if enough nodes agree. Reads can then be served from any replica, because all of them are up to date.
Strict consistency matters here because Git clients behave badly with eventual consistency. If a CI runner clones a repository and cannot find a commit that was just pushed, the build fails in confusing ways.
Where Spokes Starts to Strain
Cursor argues that two things have changed since 2013:
- Replica count and throughput. In three-phase commit, each step is as slow as the slowest server, so adding replicas makes push throughput worse. That is a problem for large monorepos that need many replicas to serve CI traffic.
- Many small repositories. Coding agents create huge numbers of small, often throwaway repositories. Spokes still needs three replicas for each one, even if they are almost never touched.
There is also an operational cost. Because the on-disk copies are the source of truth for consensus, every copy matters a lot. Teams need a routing table of where each repository lives, constant checksumming and fast repair jobs, because losing two of three healthy copies means losing the quorum needed to accept pushes.
Continuity: The Core Idea
Continuity keeps the good parts of Spokes, such as normal Git repositories on fast NVMe disks and reuse of upstream Git tooling, but changes where the truth lives.
When a push arrives, it is stored as an entry in a write-ahead log in S3-compatible object storage. The key rules are:
- A push is never acknowledged until it is fully persisted.
- Each push is stored as its own object, and the packfile is written to local disk and uploaded to S3 at the same time.
- Uploading an entry does not make it visible. A push becomes visible only after its reference transaction succeeds on a local copy and a pointer to the entry is recorded in a WAL index file, which is itself an object in the store.
- This forces all pushes to be linearizable, meaning they behave as if they happened one at a time in a single order.
To avoid hitting a hard cap from S3 write latency, Cursor batches operations instead of doing one S3 write per push. And because the reference transaction only has to be coordinated with one local repository instead of a quorum of replicas, pushes can be ingested about as fast as the disk allows.
No Routing Tables, No Elections
In Spokes, you must know exactly where every repository lives. In Continuity, the answer is "anywhere." The local copy on disk is treated as a warm cache, and the WAL in S3 is always the truth. If a repository is missing from a machine, it is rebuilt from the WAL.
To avoid doing that unnecessarily, Cursor uses rendezvous hashing, which maps a repository ID to a ranked list of nodes using only the ID and the current set of healthy nodes. If that state is stale, it does not matter, because the repository is simply materialized on whichever node comes next.
The same idea removes the need for elections. Any server can act as the primary, because updates to the WAL index are protected by an atomic compare-and-swap (CAS) operation on S3. In practice, Cursor consistently picks the top server from the hash ranking, since letting any server write causes CAS retries that slow pushes down. During deploys, failovers or network problems it does not matter exactly which server is primary. Cursor describes the goal as a system that is always correct when degraded and fast when healthy.
Replication with UDP Gossip and ETags
Because S3 holds the log, replicas can catch up directly from it, so the number of replicas is not limited by a consensus protocol. Cursor sends small gossip messages over UDP so replicas learn about new pushes quickly.
UDP is unreliable, but that does not affect correctness. Each replica remembers the ETag of the last WAL index it has seen. On a read, it makes a conditional GET to S3:
- A 304 response means the replica is up to date, and it can serve the fetch or clone right away. Cursor says this metadata-only check takes under 10 milliseconds on average.
- A 200 response returns the newest WAL index, which the replica uses to catch up before serving the read.
This design lets each repository get the number of replicas it needs. A large monorepo can run on hundreds of replicas for CI, millions of tiny agent repositories can run with a single replica each, and idle repositories can be removed from disk and rebuilt later when someone fetches.
Compaction: Paying the Cost Once
Write-ahead logs need compaction, because replaying a very long log gets expensive. Git repositories also need periodic repacking, since each push or fetch creates another packfile, and lookups slow down as the number of packfiles grows.
In Spokes-style systems, repacking is CPU-heavy and must happen on every replica, which can even cause a failover if two nodes repack the same repository together. In Continuity, only the primary compacts. The result applies to both the local repository and the WAL, and replicas simply download the compacted packs from S3. That trades extra bandwidth for lower CPU use.
The Numbers Cursor Reports
All figures below come from synthetic tests on Cursor's own monorepo, called everysphere:
- Reads scaled linearly with up to 100 replicas, with no regression in push throughput.
- Pushes reached up to 120 per second on S3 Standard, while compacting and replicating the compacted data to other nodes.
- Pushes exceeded 300 per second on S3 Express One Zone, where S3 write latency is much lower. At that rate, Git compaction became the bottleneck rather than storage.
- Cursor says all tested pushes were linearizable and persisted to external storage before acknowledgment, and all clones were fully consistent.
What Developers Can Learn From This
These are our own takeaways, not claims from Cursor:
- Treat local disk as a cache when you can. If the durable log can rebuild any node, failures and deploys become much less scary.
- Prefer a simple atomic primitive over a consensus protocol when it is enough. Here, a single CAS operation on object storage replaced elections and quorum voting.
- Design for correctness when things are degraded. Gossip packets can be lost and routing can be stale, but reads are verified against the source of truth.
- Reuse proven tools. Continuity still runs normal Git repositories using standard Git, so it benefits from years of upstream optimization.
Caveats and Open Questions
Before treating this as a template, keep these points in mind:
- The performance numbers are self-reported and come from synthetic tests. InfoQ noted that a commenter pointed out they had not been independently verified.
- The design trades replica coordination for other costs: validation against S3, asynchronous propagation and extra bandwidth.
- Engineers commenting on the design raised practical questions about push consistency, force-push transactions and point-in-time recovery. Cursor says its log gives full provenance of pushes and repacks and lets it rewind or fast-forward replicas.
- At very high push rates, Git compaction, not S3, becomes the limit, and Cursor says it is working on better on-disk layouts to reduce that impact.
Frequently Asked Questions
What is Cursor Continuity?
Continuity is Cursor's Git storage system. It keeps a write-ahead log in S3 as the source of truth for each repository and treats the copies on local NVMe disks as caches that can be rebuilt.
What is a write-ahead log?
A write-ahead log is an append-only record of changes. A change is saved to the log before it is considered done, so the current state can always be rebuilt by replaying the log.
Why does Continuity use S3?
S3 provides durable storage that scales almost without limit, and its atomic compare-and-swap lets any server safely update the log. That removes the need for elections and a separate database to track repository locations.
Does Continuity replace Git?
No. Local copies are normal Git repositories on disk, and Git clients still send and receive packfiles as usual. Continuity changes how the server stores and replicates the data.
What is Origin?
Origin is Cursor's Git hosting platform. According to Cursor, it is the product built on Continuity, aimed at teams that need more reliability, performance and scale from their Git hosting.
Key Takeaways
- Continuity makes an S3 write-ahead log the source of truth and treats local repositories as rebuildable caches.
- Pushes are acknowledged only after they are persisted, and all pushes are linearizable.
- Atomic compare-and-swap on S3 replaces leader elections, and rendezvous hashing replaces routing tables.
- Replicas catch up through UDP gossip plus ETag checks, and correctness never depends on gossip arriving.
- Cursor reports 120 pushes per second on S3 Standard and over 300 on S3 Express One Zone in its own synthetic tests.
Sources: Git at any scale (Cursor Blog) and InfoQ's report on Cursor's Continuity.



