Skip to content

Graphite is joining Cursor to reimagine the future of software development.

Read more

How Shopify cut merge queue delays from hours to minutes with the Graphite Merge Queue

Shopify’s engineering organization reached a pivotal moment: a rapidly growing volume of code changes converging with an ambitious shift toward a centralized monorepo. As pull request volume increased and work centralized in a single repository, merge wait times rose as Shopify pushed beyond the limits of traditional merge queue designs. By partnering with Graphite and innovating on the traditional merge queue design, Shopify moved merge wait times from hours to minutes and reclaimed over 27,000 engineering hours a year* by aligning merge behavior with real code independence, and unlocked a new chapter in how teams working in large codebases will continue to ship safely and quickly.

The early bottleneck

Developers rely on CI passing to tell them their code is safe to merge. As Henrique Andrade from Shopify explains, “When companies are smaller, you write your code, CI runs, everything is green, and then you merge! It’s simple.” But Shopify’s engineering team, volume of code changes, and the size of the codebase they manage required a much more scalable approach.

Even with a highly mature internal merge queue in place, Shopify began to hit a new class of limitations as the engineering org scaled and moved toward a monorepo structure. Henrique described the underlying challenge: “You can have ten developers, each with a PR passing CI. But because each snapshot of the repo is local to the developer, there’s no guarantee those changes together won’t break the build or, worse, production, once merged.” Traditional merge queues solve this by serializing how code changes land in a repository's main branch, but at monorepo scale, that becomes a bottleneck.

As more independent components were consolidated into a single repository, Shopify’s internal queue still treated all changes as potentially conflicting, forcing them through one global line. The result was a severe decrease in velocity. By September 2025, the cost of a single global queue had become impossible to ignore. Shopify was seeing P90 merge times of 693 minutes —over 10 hours for changes waiting to land.

Graphite’s Merge Queue didn’t replace Shopify’s solution because it was lacking, it outperformed it by rethinking how a merge queue needs to work in a monorepo. By introducing virtual queues that safely parallelize independent work, Graphite was able to dramatically reduce merge delays while preserving the same safety guarantees Shopify’s internal system was known for. The outcome was a step-function improvement: a merge queue that surpassed an already world-class implementation and reset expectations for what’s possible at scale.

Why traditional queues fall short in a monorepo

Shopify’s move to a monorepo (mainly to spur reuse, create a common DevEx, standardize tooling and processes, as well as centralize backend services, mobile apps, web interfaces, and more) made the limitations of a nascent merge queue even clearer. Soon enough, in Shopify’s monorepo, unrelated changes blocked one another in a linear queue, even when they had no dependency intersection. “If component A and component B are totally independent, a developer touching A should never have to wait for B,” Henrique noted. This insight became the seed for a new approach.

The breakthrough: Virtual queues (zones)

To address the inefficiency, Shopify and Graphite collaborated to build support for virtual queues inside the merge queue, which effectively segmented the merge queue into partitions that reflected the “zones” that make up Shopify's repository, allowing it to benefit from the fact that many code changes (e.g., a change in Zone A has nothing to do with a change in Zone B, assuming A and B are totally independent zones) really are independent from one another.

Instead of one long line, changes are routed into zone-specific partitions such as:

  • Shop app updates.

  • Point of Sale app changes.

  • Backend service improvements.

  • Web interface refinements.

Henrique explains, “virtual queues ensure developers only wait behind related zone changes, not behind every change in the repo. That’s how we moved from hours to minutes. We had a series of design conversations with Graphite starting in January, working out how these virtual queues should operate in a monorepo. It was two teams architecting interfaces and information flow together.”

When Shopify enabled virtual queues in late September, the team measured the impact directly in production. For each partition, we compared median (P50) merge time before and after partitioning, then scaled the difference across the volume of PRs flowing through the system. The result: 27,061 engineering hours saved in just a few months. This is time developers would have otherwise spent waiting in line behind unrelated changes.

 As of January 2026, Shopify now has:

  • A P90 merge time of ~41 minutes

  • Consistently fast merges, with a P50 of ~26 minutes

  • Higher confidence in the merge process and better use of engineering time.

Henrique emphasized that these gains also came while the monorepo moves were still underway. “We track our monorepo journey by the percentage of PRs flowing through it. We’re in a hybrid state, about 50% of our PRs go through the monorepo today, with hundreds of legacy repos still active. Yet performance gains happened during this transition, not after completion,” he recalls. 

The role of collaboration

Shopify had its own internal merge queue, but they chose Graphite because its design already supported stacking and safe rebase sequencing, which are critical for Shopify’s workflow. “Graphite’s merge queue was designed with stacking in mind from the outset. You need a merge queue that understands stacking to do it safely—and Graphite already had that foundation,” Henrique explains. 

But equally important was how quickly the teams worked through challenges: “Every time we hit a pothole, we addressed it quickly, understood what was broken, and fixed it.” For Henrique, that collaboration was as big a win as performance improvements. “To me, the most notable thing was the deep collaboration. It was two companies sitting down, figuring out how this should work in an efficient way,” he says.

What this means for engineering teams everywhere

Shopify’s experience shows that merge queues can’t be an afterthought as engineering organizations scale. As teams move toward monorepos, traditional, overly conservative queues quickly become a bottleneck. By aligning merge behavior with real code independence, rather than assuming every change could conflict with others, Shopify was able to dramatically reduce wait times while maintaining safety. Just as importantly, these gains came during an ongoing monorepo migration, which proves teams don’t need to wait for architectural “end states” to improve developer velocity.

Plus, the deep partnership between Shopify and Graphite was central to that success. Instead of treating the merge queue as a fixed tool, both teams collaborated deeply to design new capabilities, iterate quickly, and measure impact through concrete metrics like P50 and P90 merge times. As Henrique put it, “if Graphite wasn’t an awesome partner, we wouldn’t be where we are today.” With the next phase of merge queue evolution already underway, Shopify’s journey offers a clear blueprint for teams looking to ship faster, safer, and at scale.

Learn how to set up Graphite’s Merge Queue to start shipping more confidently at scale.


*Methodology: Partitioning was enabled on September 24, 2025. We measured the change in median (P50) merge time before and after this date, multiplied that difference by the number of PRs merged afterward, and summed the results across all partitions.

Built for the world’s fastest engineering teams, now available for everyone.