Shopify’s modular monolith: proving boundaries with running code
Shopify’s modularization effort exposed a gap between a clean dependency report and code that could run independently. A case study in ownership, static analysis, and the evidence required before extracting a service.
Choose an intermediate state that helps teams deliver
Shopify’s September 2020 account described grouping commerce code into components and assigning stewardship to every file. Ownership became clearer while boundaries remained incomplete. It also described selective service extraction: storefront rendering had distinct scaling needs, while credit-card vaulting required separation of sensitive data. These are historical accounts, not a description of Shopify’s full production architecture today.
For a technical leader planning modernization, the useful starting question is which part of delivery becomes easier after the first change. Assigning an owner can improve incident routing and review decisions before a component is independently executable. Creating a smaller isolated package may instead help a team test a frequently changed workflow. Both can be worthwhile, but they produce different evidence.
3B’s recommendation is to name that first outcome in the investment case. Choose a workflow where engineers repeatedly wait for another team, load excessive application context, or struggle to identify who approves a change. Record the delay, identify its cause, and select a boundary that can reduce it. A directory reorganization alone does not establish that the delay has improved.
Use static checks to control new coupling
Shopify’s September 2020 Packwerk article described checking references between packages in continuous integration. Existing violations could be recorded so teams could introduce enforcement while continuing feature development. It also acknowledged false negatives from Ruby static analysis. The technique made incremental adoption possible without requiring every historical dependency to be repaired first.
Current Packwerk usage documentation separates package validation from dependency checking. Packages declare allowed dependencies, and strict mode prevents adding new dependency violations to a package’s recorded backlog. The documentation now says the core tool ships with dependency checks only; other checks require extensions. Teams following older tutorials should confirm which checks their installed version actually provides.
In 3B’s proposed operating model, an accepted baseline is an engineering backlog with accountable owners. Changes to that baseline should receive the same review as changes to the dependency graph. Otherwise, updating the exception file can become an easy way to keep the build green while coupling continues to grow.
- Identify the owner of each protected package and the dependencies it intentionally permits.
- Review new exceptions for their effect on the graph, with a reason and a removal condition.
- Keep validation fast enough that developers can run it before requesting review.
Require the package to boot and execute its tests
In its February 2024 retrospective, Shopify described reducing Platform Essentials to zero reported dependency violations, then finding that it still could not boot alone. Initializers, environment setup, and loading paths outside the analyzer’s view required more work. After boot succeeded, isolated tests exposed further issues. The same retrospective explains that built-in privacy checks had been removed in Packwerk 3.0.
This history suggests three distinct acceptance gates for a modernization engagement. First, the declared dependency graph passes its checks. Second, a fresh process can load the package with only its declared dependencies. Third, representative tests pass in that environment. A result at one gate should not be presented as completion of the next.
For example, a proposed invoicing package might pass a reference check while silently relying on a global initializer to register tax rules. An isolated boot can reveal the missing registration; workflow tests can then reveal whether rounding and currency behavior remain correct. This is an illustrative design exercise, not a reported Shopify workflow. The acceptance evidence should include the clean environment definition and commands another engineer can reproduce.
Let runtime behavior challenge the proposed boundary
Shopify’s retrospective also distinguished domain components used for organizational ownership from functional packages used as executable units. It cautioned that resolving tool violations could introduce indirection without improving the code. The case supports using runtime evidence to revise a proposed boundary when the implementation resists it.
A useful review asks whether a new interface hides a coherent responsibility or merely forwards calls to satisfy a checker. Inspect the transactions, data access, initialization, and failure handling that cross the boundary. If every ordinary change requires coordinated edits on both sides, reconsider the split before introducing a network between them.
3B recommends making service extraction a separate decision with its own evidence: a demonstrated need for independent scaling, security separation, release control, or fault containment. Include network timeouts, retries, duplicate requests, data consistency, observability, and on-call ownership in the cost model. A package that runs independently creates an option to extract; the business and operational case determines whether to exercise it.
Measure the delivery result alongside architectural progress
The cited accounts do not establish a causal percentage improvement in productivity or a measured infrastructure saving from this modularization effort. Historical component counts and a falling violation backlog would not establish either outcome. This analysis therefore makes no return-on-investment claim for Shopify.
For an enterprise adopting the approach, 3B recommends comparing similar changes before and after the boundary is introduced. Track review waiting time, time to obtain a reliable test result, teams involved per change, and defects that escape into production. Retain incident and rework costs in the comparison. If the dependency report improves while engineers need more coordination to deliver, inspect the new abstractions and package layout before expanding the program.
EXECUTIVE TAKEAWAYFund a boundary with a reproducible completion test and a delivery outcome. A checked dependency graph, an isolated boot, and passing workflow tests each establish something different. Use that evidence to decide where modularization should continue and where a separately operated service earns its cost.
Shopify Engineering · A Packwerk Retrospective · February 7, 2024 ↗
Shopify Engineering · Under Deconstruction · September 16, 2020 ↗
Shopify Engineering · Enforcing Modularity in Rails Apps · September 23, 2020 ↗
Shopify Packwerk · Current usage documentation, accessed November 11, 2026 ↗
Accessed November 11, 2026.
Make the next modernization boundary testable
3B Global Enterprise Advisors works alongside technical teams to assess application dependencies, define modernization acceptance criteria, and implement platform and cloud architecture changes.
Discuss your initiative →