Skip to content
← All writing
2026-06-30 · 14 min read tanstack-startnextjsarchitecturersc

TanStack Start vs Next.js: Opposite Bets on the Boundary

Choosing between TanStack Start and Next.js? They make opposite bets on the client-server boundary -- everything else follows.

What you'll get out of this post

The thesis up front: TanStack Start and Next.js make opposite bets on the same question -- where does the client-server boundary live, and who manages it? Next.js bets the boundary is a rendering primitive baked into React, server-first by default. TanStack Start bets it's an explicit function call you opt into. Almost every other difference -- caching, type safety, deployment, bundle size -- is downstream of that one choice. Get this and you stop comparing feature lists and start comparing bets.


The one question both frameworks answer differently

Every full-stack framework has to draw a line: which code runs on the server, which runs in the browser, and how does a value cross from one side to the other? That crossing is the client-server boundary, and it's the single most consequential design decision a meta-framework makes. The two frameworks here answer it in opposite ways.

Key Concept

The client-server boundary

The point in your app where code stops running on the server and starts running in the browser (or vice versa), and where data has to be serialized to make the trip. Every full-stack framework has one. The design question is whether the boundary is implicit -- the framework decides and manages it for you -- or explicit -- you mark it yourself with a visible construct. Next.js and TanStack Start sit at opposite ends of that axis.

Next.js bets on RSC. React Server Components make "this runs on the server" the default. A component is a server component unless you opt out with "use client". The boundary isn't something you call -- it's a property of where a component sits in the render tree, resolved by React and the bundler. Mutations go through Server Actions, themselves wired into React's form and streaming model. The framework also owns a layered cache that decides what gets recomputed and when. The boundary is woven into the rendering primitive.

TanStack Start bets on type-safe RPC. There is no server-by-default. You write a normal app, and when you want something to run on the server you wrap it in createServerFn -- an explicit, typed function call. Routing, data loading, and caching aren't one fused system; they're composable libraries (TanStack Router + TanStack Query) you assemble, each independently typed. Underneath sits Vite for the build and Nitro for the server runtime. The boundary is a function you can point at.

Same boundary, opposite default

Next.js
server is the default
→
RSC render tree
boundary = where a component sits
→
"use client"
opt OUT to reach the browser

The framework draws and manages the boundary; you annotate exceptions

↓

TanStack Start
client is the default
→
createServerFn()
boundary = an explicit typed call
→
compiler split
opt IN to reach the server

You draw the boundary by hand; the framework type-checks the crossing

Hold those two pictures side by side. Everything below is a consequence of them.


How TanStack Start actually works

If you've only read the marketing, the mechanism is worth seeing, because it's where the "explicit boundary" claim gets concrete.

Start is a full-stack framework layered on TanStack Router. The headline property of that router is that the typed route tree is isomorphic -- the same tree runs on the server and the client, so route params, search params, and loader data are inferred end to end. Around it sit Vite (dev server, HMR, production build), Nitro (the same server engine Nuxt uses, which adapts one build to many deploy targets), and Seroval (serialization that survives the network trip -- Date, Map, Set, even ReadableStream).

The interesting part is createServerFn. You write one function. The compiler splits it into three implementations:

  1. The server RPC handler -- the real function body, exposed at an endpoint like /_serverFn/[id].
  2. The client stub -- the body is replaced with a fetch to that endpoint, arguments serialized via Seroval. This is what the browser bundle ships.
  3. The SSR wrapper -- during server rendering, it dynamic-imports the real body and runs it locally, skipping the HTTP hop entirely.
import { createServerFn } from "@tanstack/react-start";
import { z } from "zod";

export const getUser = createServerFn({ method: "GET" })
  .validator(z.object({ id: z.string() }))
  .handler(async ({ data }) => {
    // Real body: only ever exists on the server.
    // In the browser bundle this is replaced by a fetch.
    return db.user.findById(data.id);
  });

// Callable from anywhere -- a loader, an event handler, an effect.
const user = await getUser({ data: { id: "42" } });

Three things matter about this. It's type-safe end to end: the input validator (Zod or Valibot) and the return type flow to every call site, across the network boundary, with no hand-written client. It supports middleware chaining, GET/POST, CSRF protection, and a 1MB GET cap. And it's callable from anywhere -- a loader, a click handler, a useEffect -- because it's just a function, not a construct welded to a <form>. (Start also has separate Server Routes for plain REST/API endpoints, distinct from server functions.)

The build emits two bundles -- dist/client and dist/server -- and uses package export conditions to keep server-only code out of the browser. The point of the whole machine: the boundary is a thing you named, and the compiler honors your naming three different ways depending on context.

⚠️

RSC in Start is experimental -- do not pick Start for RSC today

Start's core rendering is full-document SSR + streaming + hydration (it dehydrates state into window.__TSR_DEHYDRATED__), plus SPA and SSG/prerender modes. React Server Components support is landing as a non-breaking, experimental v1.x addition -- it is not at Next.js parity. At least one comparison post has overstated this as "full RSC parity"; it isn't. If RSC is a requirement, that requirement points at Next.js right now.


How Next.js draws the same line

Next.js 16's core model is the App Router built on RSC: server components by default, client components opt-in via "use client". The Pages Router still exists but is legacy. Mutations use Server Actions -- a server primitive coupled to React's form and streaming model, marked with "use server".

The part that earns Next.js its complexity reputation is caching. Historically it ran several layers at once -- a fetch cache, a full route cache, a router cache -- with their own interactions and invalidation rules. Next 15 simplified the defaults (uncached by default). Next 16 introduces Cache Components (use cache with cacheLife/cacheTag) and Partial Prerendering (PPR), which lets one route ship a static shell with dynamic holes streamed in. This is genuinely powerful: it's the auto-optimization Start's explicit model deliberately gives up. But note what it still is -- a framework-managed, implicit, layered cache with tag-based invalidation semantics. The framework decides what's cached and when it's stale; you steer it with annotations.

Build is Turbopack (default in 16). The runtime is Node (Fluid Compute on Vercel; middleware now runs full Node). Next is self-hostable via next start / standalone output -- but ISR, image optimization, edge behavior, and preview deployments are most turnkey on Vercel. Self-hosting elsewhere leans on adapters like OpenNext, with caveats. And the ecosystem is the largest in React: the deepest talent pool, and mature, ready-made patterns for auth, commerce, CMS, and SEO.


The comparison, on the axes that matter

AxisTanStack StartNext.js 16
Rendering modelSSR + loaders; RSC experimentalRSC-first; SSR/SSG/PPR
Client/server boundaryExplicit typed RPC (createServerFn), compiler splits 3 waysRSC + Server Actions; a React render primitive
Routing / dataTyped route tree + loaders + TanStack QueryFile convention + RSC + Server Actions
Type safetyEnd-to-end: params, search, server-fn in/out all inferredLooser at the boundary; usually hand-narrowed with Zod
BuildVite (fast HMR / cold start) + NitroTurbopack
Caching philosophyExplicit SWR (TanStack Query); no implicit layersFramework-managed layered cache + Cache Components / PPR
Deploy / lock-inNitro deploy-anywhere, no lock-inSelf-hostable, but best on Vercel
Client bundle~30-35% smaller in public benchmarksLarger
MaturityNewer, composable, each piece independently replaceableMature, huge talent pool, turnkey patterns

The table is the what. The four judgments below are the why, and they're where a real decision gets made.

1. Implicit vs explicit is the core fault line

This is the whole post in one row. Next.js makes "this runs on the server" an almost-invisible default and hides the cache behind framework-managed layers. The upside is real: server-first rendering and auto-optimization you get for free. The cost is that the boundary and the cache become an implicit framework-managed layer -- which is exactly a debugging-cost indirection. When a value is wrong or stale, "where did this actually come from, and why is it cached?" can span several layers that don't show up at the call site. That's the debugging-hops bill every indirection layer charges, and Next's layered cache is a place it comes due.

TanStack Start inverts the bet. The boundary is one function call you can grep for; caching is the stale-while-revalidate model you already know from TanStack Query, with no hidden layers. The mental model is smaller and more greppable. What you give up is the server-first auto-optimization -- nobody is silently moving work to the server or prerendering a shell for you. You buy clarity and pay in convenience.

2. Type safety is Start's hardest real differentiator

This one isn't marketing. In Start, route params, search params, and server-function input/output are inferred end to end -- across the network boundary -- from a single source of truth. Rename a route param and the call sites fail to compile. Next.js is looser precisely at the RSC/Server Action boundary, where you typically hand-narrow inputs with Zod and trust yourself to keep types in sync. For a small app this is noise. For a large, long-lived codebase with many engineers, end-to-end inference is a real, compounding reduction in maintenance cost -- the kind of thing you feel in year two, not week one.

3. The deployment model decides your lock-in

Start makes deploy-anywhere a first-class architectural property: Nitro adapts one build to Cloudflare Workers, AWS Lambda, Netlify, Vercel, Node, Deno, or Bun, with no vendor coupling (Node >= 22.12). Next.js is technically self-hostable, but RSC streaming caches, ISR, and image optimization carry constraints off Vercel, and the truly turnkey path is Vercel. This isn't a knock -- Vercel runs Next.js superbly. It's a question to answer honestly up front: if you are not on Vercel and don't intend to be, weigh this seriously, because it's expensive to discover late.

4. Maturity is Next.js's moat

RSC is a stable, battle-tested production path in Next.js and an experimental addition in Start. On top of that, Next has the largest React talent pool and the most ready-made patterns, which directly lowers onboarding and maintenance cost -- you are rarely the first person to hit your problem. Start bets on composability instead: Router, Query, and server functions are each independently excellent and independently replaceable, but you assemble the pieces and own the seams yourself. Composability is power and homework at the same time.

💡

The bundle-size number, in context

Start's ~30-35% smaller client bundle in public benchmarks is a genuine consequence of the explicit-boundary bet (less framework runtime shipped to the browser), not a tuning trick. Treat it as a real directional signal, not a guarantee for your specific app -- your code, not the framework, dominates bundle size past a certain point.


So which one

This is not a replacement story. It's two coherent architectural bets, and the right answer is the one whose bet matches your constraints.

Match the bet to the project

HeaderMeaningExample
Choose Next.jsYou want mature production RSC, the biggest ecosystem and talent pool, and turnkey ISR / image optimization / PPRContent / commerce / SEO-heavy product, already on or happy to be on Vercel
Choose TanStack StartYou want end-to-end type safety, no platform lock-in, and one unified data mental modelApp-like dashboard or interaction-heavy product; self-host / Cloudflare / AWS / Bun; already invested in TanStack Query
Don't choose Start FOR rscIts RSC support is experimental and not at parity -- picking Start to get RSC is picking the wrong tool todayIf RSC is a hard requirement, that requirement is a vote for Next.js
Don't fight Next's cacheIf you don't rely on RSC and the layered caching model is fighting you, Start's explicit simplicity is a real win, not a downgradeInteraction-heavy app where you'd disable half the cache layers anyway

The one-liner to close on: Next.js trades implicit complexity and platform affinity for integration and ecosystem; TanStack Start trades youth and missing RSC for type safety and deployment freedom. Neither is winning a war. They made opposite bets on the boundary, and your job is to know which bet you're placing.


Iron rules

⚡ Iron Rule #1

Decide where the boundary lives before you compare features

Next.js makes the server the default and manages the boundary for you; Start makes it an explicit, typed call you own. Pick the bet that fits your team and product first -- caching, type safety, bundle size, and lock-in all fall out of that one choice. Comparing feature lists before you've made this call is comparing symptoms.

⚡ Iron Rule #2

An implicit framework layer is convenience bought with debugging cost

Next's server-by-default plus layered cache is real auto-optimization you get for free -- and it's an indirection layer, so it bills you in "where did this value actually come from?" Start's explicit boundary is more greppable and gives up the free optimization. Know which currency you'd rather pay in before you commit.

⚡ Iron Rule #3

Let RSC need and lock-in tolerance be the tiebreakers

If you need production RSC today, that alone points at Next.js -- Start isn't there yet. If you can't tolerate platform lock-in, that alone points at Start -- Nitro makes deploy-anywhere first-class. When the softer factors are a wash, these two hard constraints usually break the tie cleanly.


Sources

For the parent principle behind judgment #1 -- what an implicit framework-managed layer buys and what it costs to debug -- see Another Level of Indirection: The Oldest Trick in CS.