A repository holds a web app, an admin panel, a shared UI library and a package of API types. Every pull request runs the same pipeline: install, lint, typecheck, test, build. It takes fourteen minutes. Ten of those minutes rebuild packages that nobody touched.
Someone proposes Turborepo. Someone else prefers Nx. A third person asks why the current setup is not enough.
This article answers the questions that decide that argument:
- What do these tools actually solve, and what do they leave untouched?
- Can you run a monorepo without either of them, and for how long?
- At what point in a project does adding one pay for itself?
- What are their limits?
- Can you host the cache on your own infrastructure, and what does that cost?
- Are these development tools or production tools?
- What do you pay, in money and in ownership?
Product details and prices were verified on 24 August 2026. The versions referenced are Turborepo 2.10.11 and Nx 23.1.1. Pricing, plugin coverage and cache hosting policies change often. Check the linked vendor pages before making a purchasing decision.
The problem is repeated work, not the number of packages
Both tools are, at their core, a cache with a scheduler attached.
For each task, the tool collects everything that can influence the result: source files it declares as inputs, the dependency versions from the lockfile, the task configuration, and the environment variables you list. It hashes all of it. If that hash already exists in the cache, the task does not run. The declared output files are restored from the cache and the original terminal output is replayed. If the hash is new, the task runs and its outputs are stored under that hash.
Two other jobs sit on top of that cache.
Ordering and parallelism. The tool reads the dependency graph between packages and knows that a library must be built before the app importing it, while two unrelated libraries can build at the same time on different cores.
Knowing what changed. Given a base commit, the tool can determine which packages are affected by a change and which are not, so a pipeline can skip whole steps instead of running them for nothing.
That is the whole product category. The value you get from it is roughly:
the share of tasks whose inputs did not change, multiplied by how long those tasks take, multiplied by how often you run them.
A repository with sixty packages that all change on every release gets very little. A repository with eight packages where two change per pull request gets a lot. Package count is a bad proxy. Repetition is the real variable.
What you already have without either of them
Every modern package manager ships a workspaces feature. It gives you one lockfile, one install, symlinked local dependencies and a way to run scripts across packages in dependency order.
# pnpm-workspace.yaml
packages:
- "apps/*"
- "packages/*"
# install once for the whole repository
pnpm install
# build every package, in dependency order, in parallel where possible
pnpm -r build
# build one app and everything it depends on
pnpm --filter "web..." build
# in CI, skip a step when nothing relevant changed
git diff --quiet origin/main -- packages/ui || pnpm --filter ui test
That baseline is more capable than most teams give it credit for. It handles topological ordering, scoping by package, and a coarse form of change detection. Add your CI provider’s cache for the package store and framework caches, and a small repository can stay fast for a long time.
Here is what the baseline does not give you:
- No output cache. Your CI caches downloaded dependencies, not the result of
buildortest. Rerunning the same test suite on the same code costs full price every time. - No sharing. A colleague who pulls your branch rebuilds everything you already built. So does every CI job, on every machine.
- No task graph. Scripts run per package, not per task. There is no way to express that
testneeds the upstream packages built first butlintdoes not. - No environment awareness. Nothing notices that a build ran with a different value of an environment variable and therefore should not be reused.
- Change detection is manual. The
git diffline above is fine until it grows into a homemade dependency graph in bash.
If you are running one deployable application, a handful of packages, and a pipeline under about five minutes, the baseline is the correct answer and a build tool is a distraction. Most projects should start here, and some should stay here forever.
Five signals that it is time
- CI wall clock is over ten minutes and most of it repeats unchanged work. Look at a real pipeline run and mark which tasks touched files that changed in the pull request. If half or more did not, a cache pays.
- You ship more than one deployable from the same repository and they share code. A web app and an admin panel importing the same design system is the canonical case.
- Two or more teams merge into the same repository every day. Shared caching turns their work into your speed rather than your queue.
- You have already written the homemade version. A shell script that inspects
git diffand decides which jobs to run is a build tool with no tests and one maintainer. - The local loop hurts. Developers rebuild four packages to start one app, several times a day.
Two signals point the other way. If your pipeline is dominated by cold work that genuinely changes every run, a cache has nothing to reuse. And if your bottleneck is a slow end to end suite that touches everything, what you need is sharding or distribution, not caching.
Measure before you install anything. One week of pipeline data and an honest count of unchanged tasks is worth more than any comparison table, including the one further down this page.
Turborepo: a scheduler with a cache, and little else
Turborepo is MIT licensed, written in Rust and maintained by Vercel. Its design assumption is that your package.json scripts already describe the work. turbo.json only describes how those scripts relate to each other.
// turbo.json
{
"$schema": "https://turborepo.com/schema.json",
"tasks": {
"build": {
// build upstream packages first
"dependsOn": ["^build"],
"inputs": ["src/**", "tsconfig.json", "package.json"],
"outputs": ["dist/**", ".next/**", "!.next/cache/**"],
"env": ["NODE_ENV", "NEXT_PUBLIC_API_URL"],
},
"test": { "dependsOn": ["build"], "outputs": ["coverage/**"] },
"lint": {},
"dev": { "cache": false, "persistent": true },
},
}
What you get:
- Local and remote caching of task outputs and logs.
- Scheduling across all available cores, with dependency order respected.
--filterfor scoping and--affectedfor change detection, composable together since version 2.10 (June 2026).turbo pruneto produce a minimal subset of the repository for a Docker build context.turbo gen, a code generator built on Plop, for scaffolding packages.- Boundaries, an experimental check that packages only import what they declare.
- Watch mode, a terminal UI, and since 2.8 (January 2026) a local cache that is shared across git worktrees plus a published Agent Skill, part of Vercel positioning Turborepo as a build system for coding agents.
- A microfrontends proxy for serving several applications on one domain.
What it deliberately does not do:
- No framework plugins, executors or migration codemods. Turborepo does not know or care that a package is an Angular app.
- No distributed task execution. It parallelises across cores on one machine, not across machines.
- No versioning or publishing. Teams pair it with Changesets.
- Nothing outside the
package.jsonworld. It is a JavaScript and TypeScript tool.
The cost is zero for the tool and, as covered below, usually zero for the cache.
Nx: a build platform with a graph and a paid CI product
Nx core is MIT licensed and maintained by Nrwl. The model is different: plugins infer a project graph from the configuration files already in your repository, and expose targets you did not have to declare.
// nx.json
{
"targetDefaults": {
"build": {
"dependsOn": ["^build"],
"inputs": ["production", "^production"],
"outputs": ["{projectRoot}/dist"],
"cache": true,
},
"test": { "inputs": ["default", "^production"], "cache": true },
},
"namedInputs": {
"default": ["{projectRoot}/**/*", "sharedGlobals"],
"production": ["!{projectRoot}/**/*.spec.ts", "!{projectRoot}/**/*.md"],
},
}
On top of the same caching idea, Nx adds:
nx affected, a project graph visualiser, and the@nx/enforce-module-boundarieslint rule that turns architecture into a failing build rather than a review comment.- Generators for scaffolding, and executors that wrap tool invocations.
nx migrate, which runs codemods when you upgrade frameworks. On an Angular or a large TypeScript upgrade this alone can justify the tool.- Reach beyond JavaScript. Nx 22 added a
@nx/dotnetplugin that reads existing project files and an experimental Maven plugin, plus pnpm catalog support. - Recent correctness and ergonomics work: task sandboxing that traces real input and output access to catch undeclared dependencies, and per run performance reports showing cache hit rate, critical path and recoverable time.
The distribution features live in Nx Cloud: remote caching, Nx Agents that spread a pipeline across machines and scale with the size of the pull request, task sandboxing at scale, and a self healing CI feature that proposes fixes for failing runs. Conformance rules, circular dependency detection, cross repository visibility, SSO and single tenant or self hosted deployment sit in the Enterprise tier.
Nx Cloud pricing at the time of writing: a free Hobby plan with 50,000 monthly credits, 5 contributors and 10 concurrent CI connections; a Team plan that starts at 0 dollars and charges 19 dollars per additional contributor, 5.50 dollars per 10,000 credits and 2.25 dollars per concurrent CI connection; and custom Enterprise pricing.
The difference that actually decides it
Two differences matter. The rest is preference.
Where the ceiling is. Turborepo makes one machine stop repeating itself and gives the shared cache away. Nx does the same and then sells the part that needs a coordinator, namely spreading a pipeline across many machines. If your complaint is “we rebuild things that did not change”, both tools fix it and Turborepo fixes it with fewer concepts. If your complaint is “even with a perfect cache, our test suite cannot finish fast enough on one runner”, Nx Cloud has an answer in the box; with Turborepo you shard the CI matrix yourself or rent bigger machines.
How much of your repository the tool owns. turbo.json is a scheduling manifest. Delete it and your package.json scripts still build the project. Nx earns its keep through inference, generators and migrations, and the more of that you use, the more your repository’s shape becomes Nx’s shape. That is a trade, not a defect: an automated Angular major upgrade is worth real money. But it belongs in the same conversation as any other dependency you cannot cheaply reverse, which I wrote about in the vendor lock-in audit.
Can you host the cache yourself?
This is where the two tools genuinely diverge in 2026.
Turborepo: self-hosting is a first class path
The remote cache speaks a documented HTTP API. Any server implementing the v8 endpoints works, and turbo login --manual points the CLI at your own URL, team and token. Several open source servers exist, including ducktors/turborepo-remote-cache and brunojppb/turbo-cache-server. Artifacts can be signed with HMAC-SHA256 by setting signature: true in turbo.json and providing a signature key, so an artifact that fails verification is treated as a cache miss.
The managed option is free. Vercel Remote Cache costs nothing on all plans, including for teams that do not host anything on Vercel, subject to fair use limits: 100 GB of uploads per month on Hobby, 1 TB on Pro and 4 TB on Enterprise. Artifacts expire after seven days, and a team owner can clear the whole cache from the dashboard.
Nx: the official self-hosted packages were withdrawn
Until recently, Nx shipped bucket backed cache plugins you could point at your own S3, GCS, Azure or shared filesystem storage. On 21 May 2026 all four were deprecated: @nx/s3-cache, @nx/gcs-cache, @nx/azure-cache and @nx/shared-fs-cache. The reason was not a bug that could be patched but a design flaw, described below. The packages remain on npm so existing builds do not break, they receive no updates or security fixes, and they may be removed.
That leaves four options for a team that wants Nx caching:
- Nx Cloud, which is free to start and requires no infrastructure.
- Your own server implementing the Nx remote cache OpenAPI specification. Community implementations exist, and commercial hosted alternatives have appeared. This is the closest equivalent to the Turborepo self-hosting story, but you are implementing against a spec rather than picking up a blessed package.
- Nx Enterprise, which offers region specific, single tenant or self hosted deployment, including a Helm chart for running the agent cluster on your own infrastructure.
- No remote cache at all. Local caching still works, and so does everything else in Nx.
Worth noting for teams already on Vercel: the Vercel Remote Cache SDK includes an Nx package, so the free managed cache is reachable from Nx as well as from Turborepo.
The honest cost of self-hosting either tool is not the object storage bill. It is an always on service, a credential to rotate, an availability expectation, and a person who owns it when a cache miss storm slows every pipeline in the company on a Friday afternoon.
The cache is a security surface
If you take one thing from this article to your security review, take this section.
CVE-2025-36852, named CREEP, exploits the rule every one of these caches follows: first to cache wins. Whichever build first uploads an artifact for a given hash owns that hash everywhere it appears later.
The attack is simple. A contributor opens a pull request that changes no source code but modifies the CI workflow so the build produces a malicious artifact. The workflow file is not part of the cache key, so the pull request hashes to exactly the key that the protected branch will hash to. It uploads first. The next build on main gets a cache hit, skips the work, and ships the poisoned artifact. Correct and poisoned artifacts are indistinguishable at validation time, because the tampering happened while the artifact was being built, not in transit or storage.
This is not an Nx problem. It affects bucket based and homemade caches across build systems and languages, which is exactly why Nx withdrew its own self-hosted packages rather than patching them. If you self-host a Turborepo cache with one read and write token shared by every job, you have built the same hole.
The mitigations are architectural:
- Scope the cache by trust level. Protected branches write to the shared cache; pull requests read from it and write only to their own isolated namespace or bucket.
- Give untrusted CI read-only credentials. Write access belongs to jobs running on protected branches.
- Sign artifacts where the tool supports it, and keep retention short so a poisoned entry has a limited life.
- Keep a purge button and know who is allowed to press it.
The same review should cover the supply chain of the tool itself. In August 2025, malicious versions of Nx packages were published to npm for about four hours with a postinstall script that scanned developer machines for credentials and exfiltrated them; the postmortem traced it to a workflow injection through pull_request_target and an over permissive Actions token, and Nx moved to trusted publishing with OIDC, mandatory two factor approval on releases and provenance checks. The lesson generalises past Nx: a build tool runs install scripts with your developers’ credentials. Pin versions, keep the lockfile honest, and decide deliberately whether postinstall scripts may run on developer machines.
Development tool or production tool?
Neither tool ships to production. Nothing from turbo or nx runs inside your container when a user makes a request. They are build time tools, used in three places: developer machines, CI, and the deployment path.
Being in the deployment path still has consequences.
Availability is not the risk you think. If the remote cache is unreachable, builds do not fail. Both tools fall back to local cache and, failing that, simply run the task. A cache outage costs minutes, not deployments.
Correctness is the risk. If a task’s declared inputs or outputs are wrong, the tool will happily reuse an artifact that should have been rebuilt, and that artifact goes to production. This is the same failure mode as cache poisoning, arriving through incompetence rather than malice, and it is far more common.
Containers use a different cache. Docker layer caching and task caching do not know about each other. The practical pattern is to prune the repository down to what an image actually needs, build only the affected applications, and let BuildKit handle the layers.
In day to day development the payoff is the replay: switching branches, running the suite, and watching most of it come back from cache in under a second, plus watch modes and a graph you can look at when someone asks why a change in one package rebuilds seven others.
Limits worth knowing before you commit
- They make repeated work cheap, not cold work fast. The first build after a dependency bump costs full price. If your pipeline is mostly cold work, look at your test suite and your runners instead.
- They are not hermetic. Bazel and Buck2 control the entire build environment. These tools hash the inputs you declare. A different Node version, a different native toolchain or a different operating system can produce a different artifact under the same hash unless you put those facts into the key. Both tools let you do that. Someone has to remember to.
- Wrong declarations fail silently. An output directory you forgot to declare simply will not be restored, and a test that reads an undeclared file will pass on a stale cache hit. Nx task sandboxing traces real input and output access to catch exactly this; Turborepo’s strict environment mode and its newer hashing modes address the same class of mistake. Neither removes the need to think.
- They do not fix architecture. A package that everything imports invalidates everything when it changes, and no cache can help. Boundary rules push back on that, but the graph is still yours to design.
- Language reach is narrower than the marketing. Turborepo is a
package.jsontool. Nx now reaches .NET and Maven, which is a real expansion, but neither is a general polyglot build system in the Bazel sense. - A remote cache is one more dependency and one more credential, shared by everyone who builds. Treat it like production infrastructure, because on the day it is poisoned it is production infrastructure.
Where does that leave the heavier tools? If you need hermetic, reproducible builds across C++, Go, Java and JavaScript with action level caching, Bazel or Buck2 solve a larger problem at a much larger cost in expertise and migration effort. Moon and Rush sit in between, one shaped like a task runner with more built in project rules, the other focused on strict dependency management and publishing at scale. If Turborepo versus Nx is a live question in your team, you are almost certainly not in Bazel territory yet.
Which one, for which situation
| Situation | Practical answer | Why |
|---|---|---|
| One application, a few packages, pipeline under five minutes | Neither | Workspaces plus a dependency cache already cover it. Revisit when a signal above appears. |
| Several deployables sharing libraries, JavaScript and TypeScript | Turborepo | Lowest concept count, free managed cache, and a config you can delete without breaking the build. |
| The same, but with a strong preference for owning the cache | Turborepo self-hosted | A documented API, several open source servers, and artifact signing available out of the box. |
| Angular or a large enterprise front end estate | Nx | Generators, boundary rules and nx migrate on framework upgrades are the reason the tool exists. |
| Mixed JavaScript and .NET or Maven in one repository | Nx | The only one of the two that reads those project files and puts them in the same task graph. |
| Pipeline still too slow with a perfect cache hit rate | Nx Cloud | Distribution across machines is the feature Turborepo does not have. |
| Regulated environment, no third party cache permitted | Either, self-hosted | Turborepo has the shorter path; with Nx, plan for the OpenAPI route or an Enterprise deployment. |
| Hermetic polyglot builds, thousands of targets | Neither | That is a Bazel or Buck2 problem, with the staffing that implies. |
What it costs
Turborepo. Zero for the tool. Zero for the managed cache inside Vercel’s fair use limits. Self-hosting costs one small always on service, object storage, and the ownership that comes with it. Setup for a mid size repository is one to three days, most of it spent declaring inputs and outputs honestly.
Nx. Zero for the core. The Hobby tier of Nx Cloud is genuinely usable for a small team. Costs appear as contributors, credits and concurrent CI connections grow, which is also when the savings appear. The comparison to run is not “credits versus zero”; it is credits versus the bigger runners, the extra CI minutes and the developer waiting time you would otherwise buy.
The number that decides it. Take your busiest week, count total pipeline minutes, and estimate the share of tasks whose inputs did not change. Below roughly thirty percent, caching is not your problem and a new tool will not become one. Above that, multiply the saved minutes by merges per day and by the cost of a developer waiting. That figure, not a feature table, is the business case.
An adoption path that does not disrupt the repository
- Week one, measure. Pipeline duration, per task duration, and how often each task’s inputs actually change. Keep the numbers; you will need them to know whether the change worked.
- Week one to two, local only. Add the tool, declare inputs, outputs and environment variables for
build,lint,testandtypecheck. Verify that a second run of an unchanged task is a cache hit and that the restored outputs are byte for byte correct. Do not touch CI yet. - Week two to three, remote cache with trust boundaries. Turn it on read-only for pull request jobs and writable only from protected branches. Watch the hit rate.
- Week three to four, narrow the pipeline. Switch CI to affected plus filtered runs, and delete the homemade
git diffscript. - Later, only if the numbers still hurt. Consider distribution across machines, boundary rules and generators. Each of these is a separate decision with its own justification.
Rolling back matters too. With Turborepo you delete turbo.json and keep your scripts. With Nx, plan the exit before you adopt executors and generators broadly, because that path is longer.
The question is not which tool
It is whether repeated work is your bottleneck, and who you want to own the cache that removes it.
If the repetition is real, Turborepo is the cheaper first answer and stays out of your way. Nx is what you graduate to when the project graph, the framework codemods, the boundary rules or the distribution across machines are worth their extra concepts, and when you are comfortable that the caching layer you depend on is either theirs to run or yours to build against a specification.
If the repetition is not real, workspaces and an honest CI cache will carry you further than any new tool, and the fourteen minute pipeline is telling you something else entirely.
