GitHub’s Agent-Scale Git Infrastructure Explained13 min read2,510 words

GitHub’s Agent-Scale Git Infrastructure Explained

See how GitHub is moving Git storage to Azure with per-reference quorums and virtual replicas. Read the architecture trade-offs behind scaling for AI agents.

agent-scale Git infrastructureGitHub Azure migrationGit storage architectureper-reference quorumsvirtual read replicas
GitHub’s Agent-Scale Git Infrastructure Explained

How GitHub Is Reworking Git Storage for an Agent-Scale Future

AI agents are changing what Git infrastructure has to handle. With more automation, you get more pushes, more branches, and a lot more repository activity happening at the same time. For GitHub, that growth ran into a practical wall: adding data-center capacity takes time, and power and supply-chain limits make that kind of expansion harder to do quickly.

GitHub's answer is to move repository data to Azure while changing how it coordinates reads and writes. According to the company, the migration has already placed a copy of 99.99999% of its repositories in both GitHub's own data centers and Azure. But the busiest repositories show why "moving the data" alone isn't enough. When writes have to be serialized across the whole repository, cross-region network latency can slow everything down.

So GitHub is changing coordination, not just storage location. The plan shifts from repository-wide write serialization to per-reference quorums, then adds virtual replicas backed by object storage. The goal is straightforward: increase write concurrency and scale reads independently. Here's how the architecture works, what it improves, and what still limits the system.

Why GitHub is moving repository data to Azure

GitHub frames Git operations as a Tier 0 service - something so central that lots of other parts of the platform depend on it. That makes infrastructure changes tricky. A migration can't just relocate data and hope the rest of the system behaves.

There's also timing. Git traffic has grown quickly, but power capacity in GitHub's data centers - and across the surrounding region - is constrained. GitHub says that, early in the migration, available capacity (including possible expansion) gave it time to move safely, but not enough time to move slowly.

So the sequence matters. GitHub had already prototyped cloud-based Git storage approaches, but doing a storage-platform switch and storage-architecture redesign at the same time would stack two big sources of risk. Instead, it moved repository data first, then planned to evolve the storage model after the data was already running in Azure.

A gradual migration follows the traffic

The first copy of a repository landed in Azure Central US in August 2025. GitHub says most repositories now have two of their five replicas in Azure, and Azure handles about half of Git traffic. The migration is gradual: for a while, Azure takes on growth while GitHub's own data centers stay comparatively steady.

One reason this is workable is that requests can follow replicas. Most repositories have five replicas for durability, availability, and scale. Spokes - GitHub's storage system - uses preferential routing to send requests to a replica in the same region and availability zone when possible. As more replicas move to Azure, more requests can land there. Once the last replica moves, the old region no longer needs to receive requests for that repository.

This matters operationally because it's not a one-time cutover. Data placement changes in steps, and traffic shifts as the destination becomes capable of handling it. In other words, the system doesn't rely on a single risky "all at once" move.

Why the busiest repositories are different

GitHub says it has moved a copy of 99.99999% of its repositories to Azure. The small remainder includes some of its busiest repositories. The issue there isn't just copying data. It's what distance does to serialized writes.

A replica in the target Azure region can be around 1,000 miles from GitHub's data centers. A network round trip might take about 25 milliseconds, and writes may require multiple round trips. That delay is manageable for many repositories. It becomes painful for repositories that are already close to their write-throughput limit.

In the current setup, the slowest healthy replica can effectively set the pace for when writes complete. Because writes hold a repository-wide lock while they commit, cross-region latency can reduce how fast that repository can accept updates. If pushes arrive faster than the system can finish them, they queue. That's why GitHub needs an architectural change, not just more time or faster data transfer.

How per-reference quorums improve write throughput

The main change is to shrink the part of the system that must serialize writes. Instead of treating every update to a repository as one ordered stream, GitHub coordinates updates at the level of individual Git references.

A reference is a name that points to a commit - like a branch or a tag. Git's consistency requirements apply per reference: once the server accepts an update, clients shouldn't later see an older value for that reference. They should see the accepted value or something newer. This holds whether the update is a fast-forward, a force push, or a deletion.

And here's the practical advantage: updates to different references usually don't depend on each other. A developer pushing to one branch and an agent pushing to another branch can proceed independently. They still need reliable storage and consistent results, but they don't necessarily need to wait behind the same repository-wide queue.

From one queue to independent work

In GitHub's current model, the quorum needs a majority to commit a write, but it waits for every healthy replica to respond - up to a timeout - before it moves on. When the system holds a repository-wide lock during the update, one slow write can block other writes even if they target different branches.

That's the queueing problem. Each write takes as long as the slowest healthy replica. As the arrival rate rises, the queue grows and later writes wait longer. Cross-region latency increases the time each write ties up the serialized path, which effectively lowers the repository's throughput ceiling.

Per-reference serialization changes what needs to wait. Writes to the same reference still must be ordered, but writes to separate references can be in flight at the same time. This doesn't remove latency from a single write, but it reduces how often unrelated writes get blocked behind it.

A useful mental model is the coordination boundary:

  • Repository-wide serialization: all writes compete for one lock and one ordered queue.
  • Per-reference serialization: writes to the same reference are ordered; independent references can progress at the same time.

This isn't a promise of infinite write capacity. If the workload hammers one "hot" reference repeatedly, contention still shows up there. The benefit depends on how much of the write traffic can actually be done independently.

What the tests indicate

GitHub says that in internal testing with realistic traffic, writes to different references reached roughly three to four times higher throughput at lower latency. The company also says the new approach raises a repository's write-throughput ceiling roughly in proportion to the number of references being written at once.

That tracks the bottleneck they're targeting: serialized coordination, not raw ability to move Git objects. It also makes branch-heavy workloads - like many agents or developers working on separate branches - fit cross-region replication better.

There's a trade-off, though: more protocol and state-management complexity. The system has to preserve ordering when references conflict, while letting independent updates go forward. It's a better match for how Git works, but it still needs careful handling of failures, retries, and replica health. Cutting coordination only helps if what remains is correct.

How virtual replicas separate reads from writes

Write throughput is only one part of scaling. GitHub says many repositories see between 100 and 1,000 reads for every write. In the current architecture, reads and writes use the same replicas. That means they compete for the same resources, and you can't scale them independently.

The next step is to store repository data durably in Azure Blob Storage and treat object storage as part of the write quorum. Git objects help here because they're immutable and content-addressed. With that property, the system can persist objects without requiring every storage component to keep a full, long-lived local copy.

The virtual write replica

GitHub calls the object-storage quorum member a virtual replica. It's an ephemeral compute node that sits in the write path to object storage. This node streams incoming writes and doesn't serve reads. Because it participates in the quorum, a write isn't acknowledged until the data is durable in object storage.

That durability requirement adds latency to writes. The design tries to avoid turning that into a new throughput bottleneck by batching work. The virtual write replica can coalesce transactions that touch disjoint references into fewer network I/O operations to object storage. Instead of paying one object-storage round trip per concurrent write, a busy repository can share a round trip across multiple writes.

For now, the virtual write replica also handles compaction, and read replicas pick up the compacted state. Separating read and write capacity doesn't eliminate background work like compaction - it changes where it happens and how it intersects with serving traffic.

On-demand virtual read replicas

Once object storage is the source of truth, GitHub can add virtual read replicas without making them members of the write quorum. Each can warm its cache from Azure Blob Storage, then serve read traffic while reconciling local state in the background.

This gives the system a clearer division of roles:

  • The write quorum controls when updates become durable.
  • Object storage holds the durable repository data.
  • Virtual read replicas provide compute and cache capacity for reads.

The practical payoff is independent scaling. If a repository needs more read capacity, the system can add read replicas without requiring every component to join write coordination. Those replicas can also be tuned for read workloads - rather than sharing resources needed for compaction and writes.

GitHub says its distributed load-testing setup hit limits in the current architecture. When it tested virtual read replicas, the test harness reached its own limits first. That's encouraging, but it's not the same as proving every production workload is fully solved. GitHub also notes that virtual replicas bring challenges it addresses in later steps of the design.

What the architecture changes - and what it doesn't

This migration isn't a full replacement of GitHub's existing storage platform. Spokes still has a big role: it coordinates quorum operations, routes requests, balances load, provides an API internal clients use, and runs background systems that place, repair, and rebalance repositories.

That matters because large infrastructure systems accumulate responsibilities over time. Changing a commit protocol doesn't mean rebuilding every service around it. GitHub's approach is to keep the pieces that still work, while swapping out the parts that block future scale.

The remaining write bottleneck

Per-reference serialization and virtual replicas create more room to grow, but GitHub still calls write throughput the next limit. Writes still wait on replicas that hold full copies of a repository. The difference is that, because Git objects are immutable and content-addressed, only a small portion of a write needs system-wide ordering.

The real engineering challenge is how to order that smaller portion quickly without simply moving the bottleneck somewhere else. That includes second-order effects - like where durable reference state lives, and how compaction and garbage collection scale as the system evolves.

This is why a "clean" diagram isn't enough. The protocol has to work under a service that handles repositories at enormous scale, with developers and agents changing things around the clock. It also has to be operational: failures need diagnosis, data needs repair, and capacity needs rebalancing without interrupting core Git operations.

The practical lesson for infrastructure teams

The broader takeaway isn't just "move storage to the cloud" or "use object storage." The decision sequence is more specific:

  1. Separate migration risk from architecture risk. GitHub moved data before changing the storage design, avoiding a simultaneous platform switch and protocol overhaul.
  2. Find the real coordination boundary. If unrelated updates are serialized together, the bottleneck might be the boundary, not the hardware.
  3. Scale by workload. Reads and writes need different resources. Decoupling them can be more efficient as long as durability and consistency stay explicit.
  4. Measure the next constraint. Each improvement tends to reveal what's limiting next. Adding more read replicas doesn't automatically fix write coordination, compaction, or garbage collection.

These ideas aren't unique to Git. They show up when a large shared data structure, a global lock, or a synchronous quorum forces independent operations to wait on each other. The "right" answer depends on the consistency guarantees your product actually needs. Removing coordination that protects correctness is a bug. Removing coordination that doesn't protect correctness can be a real scaling win.

Conclusion

GitHub's move toward agent-scale Git infrastructure is a sequence of controlled changes, not a single cloud migration. Moving repository data to Azure creates room to grow. Per-reference serialization lets updates to independent branches proceed in parallel. Virtual replicas then make it possible to scale reads separately from the write quorum while keeping object storage as the durable state.

Each step targets a specific constraint, and each one comes with trade-offs that still have to be managed. The design doesn't erase latency, consistency requirements, or background storage work. It changes where coordination happens, and it gives the system more ways to add capacity without forcing every workload to fight for the same resources.

For the full technical account, read GitHub's engineering post on agent-scale Git infrastructure. The question for any team trying something similar is simple: which operations truly need to coordinate, and which are waiting only because the current system makes them share a boundary?

Frequently Asked Questions

GitHub says traffic is growing while data-center power capacity and regional expansion are constrained. Moving repository replicas to Azure adds capacity and lets traffic shift gradually as each repository’s replicas become available there.
It narrows write serialization from the whole repository to an individual Git reference, such as a branch. Updates to the same reference still need ordering, while independent updates to different references can proceed concurrently.
A virtual replica is an ephemeral compute node associated with object storage. The virtual write replica streams writes and participates in the quorum so data is durable before acknowledgement. Virtual read replicas can serve reads without joining that quorum.
No. Cross-region latency still affects individual writes. Per-reference serialization reduces the way that latency blocks unrelated updates, while coalescing object-storage operations can share network I/O across concurrent writes.
Their main purpose is to scale reads independently from writes. Per-reference coordination and the virtual write replica address parts of the write path; read replicas reduce competition between read traffic and write-related work on shared resources.

Related articles