Node.js backend developers picking a framework in September 2026 face a genuinely different decision than they did five years ago. Express still ships more npm downloads than any other server framework on the planet, but most of that volume comes from legacy codebases rather than new builds. Fastify has spent the last two years quietly winning the throughput argument. NestJS has become the default answer for teams that want Angular-style structure on the server. Picking wrong costs real engineering time: a badly-fit framework shows up months later as slow onboarding, brittle validation code, or a rewrite nobody budgeted for.
This comparison pulls together the latest stable releases of all three frameworks, request-per-second benchmarks from multiple independent sources, npm download and GitHub star counts, pricing considerations for hosting each stack, and a migration path for teams moving between them. The goal is a straight answer to “fastify vs express vs nestjs” that holds up whether you are shipping a solo side project or standing up a 40-engineer platform team.
Don't miss new tech stories on Google
Add Tech Insider once in the Google app and our stories appear in your news suggestions.
Fastify vs Express vs NestJS: the short answer
Express remains the default choice for small APIs, prototypes, and any team that values the largest possible pool of Stack Overflow answers and hireable developers over raw throughput. Fastify is the pick when request-per-second numbers and schema-first validation matter, particularly for high-traffic public APIs and latency-sensitive services. NestJS is the pick for larger teams that want enforced structure, dependency injection, and a framework that scales in complexity the way the application does, and it can run on either the Express or Fastify adapter underneath.
None of the three has “won” the Node.js backend war. State of JS 2025’s back-end frameworks page notes that Express remains the usage leader while Nest is “progressing at a nice clip,” which matches what the download numbers below show: massive legacy Express usage, steady Fastify growth in performance-sensitive teams, and NestJS eating a growing share of new enterprise projects.
Latest versions: what shipped in 2026
All three frameworks are actively maintained, and each has shipped meaningful updates in 2026. Express 5, which became the default npm install target back in 2024, sits at version 5.2.1 as its current stable npm release, published in December 2025 with no newer major line behind it as of this writing. Fastify has kept a faster release cadence: its GitHub releases page shows version 5.12.5 as the latest tag, published September 17, 2026, continuing the steady patch cycle the Fastify core team has kept since Fastify 5 stabilized.
NestJS 11 is the current major line, having shipped in January 2025 with the default HTTP adapter switched from Express 4 to Express 5. A NestJS 11 upgrade brief notes the framework now requires Node.js v20 or higher, since Node 16 and 18 support was dropped, and that @nestjs/platform-fastify was updated alongside the Express adapter change. The current @nestjs/core release sits at 11.1.24, published in May 2026. None of the three frameworks has announced a next major version for late 2026, so teams adopting any of them today are building on a stable, non-transitional release line.
Fastify vs Express vs NestJS specs comparison table
| Category | Express | Fastify | NestJS |
|---|---|---|---|
| Latest stable version | 5.2.1 (Dec 2025) | 5.12.5 (Sep 17, 2026) | @nestjs/core 11.1.24 (May 2026) |
| First released | 2010 | 2016 | 2017 |
| Architecture style | Unopinionated, middleware chain | Unopinionated, plugin-based | Opinionated, modules + dependency injection |
| Built-in TypeScript support | None (requires @types/express) | First-class, typed plugin API | First-class, written in TypeScript |
| Schema validation | None built in; needs middleware (Zod, Joi) | Built-in JSON Schema via Ajv | Pipes + class-validator/class-transformer, or Standard Schema (Zod) |
| Underlying HTTP layer | Node’s native http module | Custom HTTP layer optimized for routing | Runs on Express or Fastify adapter |
| GitHub stars (approx.) | ~69,100 | ~36,000 | ~75,600 |
| npm weekly downloads (approx.) | ~91.7M (express) | ~8.8M (fastify) | ~10.0M (@nestjs/core) |
| Dependency injection | Not built in | Not built in (plugin encapsulation instead) | Built in, Angular-style |
| Default adapter for NestJS | N/A | N/A | Express v5 (Fastify optional via @nestjs/platform-fastify) |
| Learning curve for an Express developer | Baseline | Low to medium, days | Steep, roughly 2-4 weeks |
| Minimum supported Node.js | Node.js 18+ (v5 line) | Node.js 20+ (v5 line) | Node.js 20+ (v11 line) |
| Cold start time (single instance, 2026 benchmark) | ~379 ms | ~390 ms | ~815 ms |
The star and download counts above come from separate 2026 tracking sources (npmcharts.com, GitHub’s own release pages, and SoloDevStack’s 2026 comparison series) and should be read as directional rather than to-the-day exact, since npm download counts fluctuate weekly and GitHub star totals climb daily. Even accounting for that noise, the order of magnitude gap between Express’s install base and the other two is not close.
Benchmarks: requests per second across three sources
Raw throughput benchmarks for Node.js frameworks vary enormously depending on hardware, Node.js version, whether keep-alive is enabled, and whether the test hits a plain “hello world” route or a route doing JSON schema validation. Rather than pick one number and present it as gospel, here is what three independent 2026 sources measured, with the framework and configuration each one tested.
Source 1: Fastify’s own official benchmark page
Fastify’s official benchmarks page, refreshed in October 2026, now puts Fastify 5.12.5 at 50,373 requests per second against Express 5.2.1’s 27,474, a roughly 1.8x gap on a single Node.js instance under its standard test harness. The same October 2026 run reports Fastify finishing requests in 19.33 ms of average latency versus 35.89 ms for Express, and pushing 9.03 MB/s of throughput against Express’s 4.90 MB/s. This is a first-party benchmark, so it should be read with the usual caveat that framework maintainers tend to tune their own test conditions favorably, but the methodology and code are published openly for anyone to reproduce.
Source 2: DevAndDeliver’s 2026 practical comparison
An independent July 2026 benchmark from DevAndDeliver, run across all three frameworks on identical hardware, measured Fastify 5.8.5 at 100,301 req/s, Express 5.2.1 at 53,400 req/s, NestJS 11 on the Fastify adapter at 41,159 req/s, and NestJS 11 on the Express adapter at 33,344 req/s on a simple JSON response route. On a second test that added request validation, the gap narrowed but held the same order: Fastify 5.8.5 hit 42,720 req/s against Express 5.2.1’s 28,764 req/s.
Source 3: TechEmpower Framework Benchmarks
TechEmpower’s Framework Benchmarks, the longest-running independent cross-language benchmark suite, has tracked an nestjs-fastify configuration hitting over 160,000 responses per second in its composite JSON-serialization test class, run on TechEmpower’s standardized multi-core hardware. TechEmpower’s numbers run consistently higher than single-machine benchmarks because the test environment uses pipelined requests across multiple cores, so treat it as an upper bound on throughput rather than a number to expect on a typical cloud instance.
The pattern that holds across all three sources: Fastify outperforms Express on raw throughput by roughly 1.5x to 2x depending on workload, NestJS on the Fastify adapter closes most of that gap while NestJS on the Express adapter trails behind plain Express, and adding request validation narrows every gap because validation overhead becomes the bottleneck rather than routing. A fourth, independent data point backs this up: ToolChew’s May 2026 benchmark run measured Fastify 5.8.5 at 55,716 req/s against Express 5.2.1 at 35,909 req/s on the same simple JSON route, landing squarely inside the same 1.5x-to-2x band the other sources report.
Cold start and memory: what matters for serverless
Throughput is not the only number that matters if you are deploying to AWS Lambda, Cloudflare Workers, or another serverless platform where cold start latency shows up directly in user-facing response times. A 2026 academic benchmark study measured average cold start times of 379.21 ms for Express, 389.53 ms for Fastify, and 815.07 ms for NestJS, with peak memory usage of 85 MB, 90 MB, and 112 MB respectively. The same study found that under heavy simulated load of 10,000 virtual users, throughput on all three frameworks collapsed by more than 90%, with Express dropping from 60 req/s to 2.6 req/s, Fastify from 60 to 3.8 req/s, and NestJS from 60 to 5.1 req/s, a reminder that these frameworks are not interchangeable with dedicated load balancers and that horizontal scaling matters more than framework choice once traffic gets heavy enough.
NestJS’s heavier cold start is the direct cost of its dependency injection container: on every cold boot, Nest has to resolve the full module graph and instantiate providers before it can serve a request, work that Express and Fastify skip entirely because they have no built-in DI system. Teams deploying NestJS to serverless environments generally either accept the cold start penalty for workloads that stay warm most of the time, or fall back to Fastify/Express directly for functions that need to respond in single-digit milliseconds from a cold state.
Pricing and hosting cost comparison
None of the three frameworks charges a license fee. All are MIT-licensed open source projects. The cost difference between them shows up indirectly, in compute bills and engineering time rather than a bill from the framework maintainer.
| Cost factor | Express | Fastify | NestJS |
|---|---|---|---|
| Framework license cost | Free (MIT) | Free (MIT) | Free (MIT) |
| Typical compute cost impact | Baseline; more instances needed at scale due to lower req/s per core | Lower per-instance cost at scale due to higher req/s per core | Depends on adapter; Fastify adapter narrows the gap to Express-level |
| Serverless cold-start cost impact | Low, ~379 ms average | Low, ~390 ms average | Higher, ~815 ms average, can increase Lambda billed duration |
| Onboarding/training cost | Lowest; most developers already know it | Low to medium; small learning curve for plugin model | Highest; 2-4 weeks to ramp for an Express-only developer |
| Validation tooling cost | Requires adding Zod/Joi (free, but extra dependency and setup time) | Built in via Ajv, no extra dependency needed | Requires class-validator/class-transformer, or Zod via Standard Schema |
| Managed hosting support | Universal across every Node.js host | Universal across every Node.js host | Universal, though some platforms document Express-adapter examples first |
The practical read: a high-traffic public API running on Fastify can genuinely need fewer compute instances than the same API on Express, which turns into a real monthly AWS or GCP savings once you are running dozens of container replicas. For a low-traffic internal tool, that difference is noise, and the onboarding cost of the more complex option (NestJS, in particular) is likely to outweigh any compute savings.
TypeScript support and developer experience
Express was built for plain JavaScript in 2010 and has no first-party TypeScript types; every Express project pulls in the community-maintained @types/express package, which works well but is a separate dependency to keep in sync with the framework version. Fastify ships its own TypeScript definitions and documents multiple type-provider integrations, including json-schema-to-ts, TypeBox, and fastify-type-provider-zod, which let a route’s request and response types be inferred directly from its JSON Schema definition rather than declared twice. NestJS is written in TypeScript from the ground up and treats decorators, interfaces, and dependency injection as first-class citizens of the framework, which is a large part of why teams coming from Java Spring or .NET backgrounds tend to feel at home in Nest faster than in Express or Fastify.
For request validation, the three frameworks take genuinely different philosophies. Express, per the 2026 comparison research, typically pairs with Zod for lightweight, inferable runtime validation with no code generation step. Fastify compiles JSON Schemas into raw JavaScript validation functions at startup via Ajv, front-loading the compilation cost so that per-request validation is close to free at runtime. NestJS’s official docs describe a built-in ValidationPipe tied to class-validator and class-transformer decorators, alongside a newer StandardSchemaValidationPipe that supports any Standard-Schema-compatible library, including Zod, giving Nest developers a path to Zod-style validation without leaving the pipe system.
Dependency injection and architecture
This is the single biggest structural difference between NestJS and the other two. Express and Fastify are both intentionally unopinionated: Express organizes code around a middleware chain, Fastify around an encapsulated plugin system, and neither one tells you how to structure services, split business logic from route handlers, or manage cross-cutting concerns like logging or caching. That flexibility is a feature for small APIs and a liability for large ones, where every team ends up inventing its own folder structure and conventions from scratch.
NestJS solves that by borrowing Angular’s module and dependency injection system wholesale. Every piece of business logic lives in an @Injectable() provider, every provider gets wired into a controller through constructor injection, and every feature area is organized into an @Module(). This is objectively more code and more ceremony for a five-endpoint CRUD API, but it pays off once a codebase has 40 endpoints spread across a dozen engineers, because the architecture forces consistency that Express and Fastify leave entirely up to team discipline. One 2026 CTO-focused review of NestJS pegs the learning curve at roughly two to four weeks for an experienced Express developer, against hours for picking up plain Express and low-to-medium days for Fastify’s plugin model.
Ecosystem and plugin maturity
Express’s fifteen-plus-year head start shows up most clearly in its middleware ecosystem: nearly every third-party Node.js library, from authentication packages to logging tools to rate limiters, ships an Express-compatible middleware as its first or only integration path. Fastify has built out a large first-party plugin ecosystem under the @fastify/ npm scope covering CORS, cookies, JWT, multipart uploads, rate limiting, and Swagger generation, and it also ships an official Express compatibility layer, @fastify/express, for teams that need to run legacy Express middleware inside a Fastify app during a migration. NestJS wraps either Express or Fastify under the hood, so it inherits whichever ecosystem its active adapter uses, while adding its own layer of first-party modules (@nestjs/config, @nestjs/typeorm, @nestjs/graphql, @nestjs/microservices) that assume the Nest module system rather than raw middleware.
Fastify’s plugin encapsulation model is worth calling out on its own, because it solves a problem Express never addressed: preventing one part of an app from accidentally leaking state or decorators into another. Every Fastify plugin gets its own encapsulation context by default, so a database connection registered inside an /admin route group cannot be silently accessed from a /public route group unless a developer explicitly marks it global. Express has no equivalent concept; every middleware function shares the same request and application objects, which is simpler to reason about for a ten-route app and much easier to get wrong for a two-hundred-route one.
Real-time features: WebSockets and streaming
Real-time functionality is one of the clearest places where the three frameworks diverge in built-in capability. Express has no native WebSocket support at all; every Express-based real-time app reaches for a separate library, almost always Socket.IO or the ws package, wired in manually alongside the HTTP server. Fastify ships an official @fastify/websocket plugin that hooks WebSocket routes into the same plugin and schema-validation system used for regular HTTP routes, so a WebSocket handler gets the same encapsulation guarantees as an HTTP one. NestJS goes furthest here with a dedicated Gateways abstraction (@WebSocketGateway()), which wraps either Socket.IO or a raw ws adapter behind the same decorator and dependency injection model used everywhere else in a Nest app, meaning a chat feature’s WebSocket gateway can inject the exact same services a REST controller uses without any extra wiring.
For teams building anything with live updates, streaming responses, or multiplayer-style state (dashboards, chat, collaborative editors, trading tickers), this is a meaningful factor beyond raw req/s. NestJS’s Gateways cut down on the boilerplate of keeping REST and WebSocket logic in sync, while Fastify’s plugin-based WebSocket support keeps things lighter weight without giving up schema validation. Express developers get the most flexibility in library choice but have to hand-roll the integration between HTTP and WebSocket state every time.
Testing and debugging experience
Express and Fastify both test the same way most Node.js code does: spin up the app, hit it with an HTTP client library such as Supertest or light-my-request, and assert on the response. Fastify actually ships light-my-request as a first-party dependency specifically so routes can be tested without binding to a real network port, which shaves meaningful time off large test suites that would otherwise open and close hundreds of real sockets. Express projects typically reach for Supertest, which works well but does bind an actual (ephemeral) port under the hood unless configured otherwise.
NestJS ships its own @nestjs/testing module built specifically around its dependency injection system, letting a test spin up a TestingModule that mirrors the real app’s module graph but with mock providers swapped in for anything expensive, like a database connection or a third-party API client. This is a genuine advantage for large codebases: a test for a single controller can mock every one of its injected dependencies with a couple of lines, something that requires manual stubbing or a library like proxyquire in a plain Express or Fastify app that has no formal dependency injection container to intercept.
State of JS 2025 survey findings
The State of JS 2025 back-end frameworks page is the closest thing the JavaScript community has to an independent, developer-sourced popularity index, and its September-2026-visible results back up what the download numbers already suggest. Express remains the clear usage leader among respondents, while the same page specifically calls out Nest as “progressing at a nice clip,” language the survey authors use to flag frameworks gaining meaningful year-over-year mindshare rather than plateauing. Fastify does not carry the same raw usage number as Express or Nest in the survey, but shows up consistently in developer commentary as the framework people reach for when a previous project’s Express setup became a performance bottleneck.
Reading survey data like this alongside npm downloads is important because the two metrics measure different things. Downloads capture every CI run, every fresh clone, and every Docker build of every existing project, which is why Express’s ~91.7M weekly downloads look so dominant. A developer survey instead captures what people are choosing for new work and how they feel about the choice, which is where Fastify and NestJS show more relative momentum than raw download counts alone would suggest.
Hiring market and community size
Framework choice is also a hiring decision, and the three frameworks sit in very different spots on that axis. Express’s job-market advantage is straightforward: with roughly 69,100 GitHub stars, a fifteen-year track record, and the largest download base of the three, it is the framework nearly every Node.js developer has touched at some point, which means the widest possible candidate pool and the shortest possible onboarding time for a new hire. NestJS, despite roughly 75,600 GitHub stars (higher than Express’s own star count, reflecting how much attention the project draws even though its download volume is far smaller), sits in a smaller but more specialized hiring pool: developers who list NestJS experience tend to also know TypeScript deeply and have worked in more structured, enterprise-style codebases, which can be an asset for teams that want architectural discipline baked into every hire. Fastify’s roughly 36,000 GitHub stars put it behind both in raw community size, but its user base skews toward developers who specifically sought out a faster alternative to Express, which tends to correlate with stronger performance awareness on a team.
Common mistakes when choosing a Node.js framework
A few patterns show up repeatedly in post-mortems of framework decisions gone wrong. The first is picking NestJS for a project that will only ever have three or four endpoints, then spending more time wiring modules and providers than the business logic itself would have taken in plain Express. The second is picking Express for a public-facing API expected to scale to tens of thousands of requests per second, then discovering eighteen months later that the compute bill would be meaningfully lower on Fastify, at which point a rewrite is far more expensive than switching would have been at the start. The third is assuming NestJS is automatically more secure or more performant than its underlying adapter, when in the default Express-adapter configuration it inherits Express’s exact HTTP-handling code path, CVEs included, unless a team explicitly opts into the Fastify adapter.
The fourth common mistake is treating a synthetic hello-world benchmark as a promise about production performance. Every benchmark cited in this article narrows considerably once real work, like a database query or request validation, gets added to the route, and a team that picks Fastify purely for the headline req/s number without checking whether its actual bottleneck is a database call or an external API will often find the framework swap delivered far less real-world speedup than the benchmark implied.
Security posture across the three frameworks
Because NestJS defaults to the Express adapter, it directly inherits whatever CVEs and default-configuration gaps exist in Express itself, unless a team explicitly opts into the Fastify adapter, according to a 2026 comparison of Node.js framework security postures. That means “NestJS is more secure than Express” is not automatically true just because Nest adds structure on top; the underlying HTTP handling is the same code path in the Express-adapter configuration. Fastify’s built-in JSON Schema validation does provide a meaningful security advantage for input validation specifically, since malformed or oversized payloads get rejected by the compiled Ajv validator before they reach application code, closing off a common source of injection and denial-of-service bugs that Express developers have to remember to guard against manually with middleware.
Migration guide: moving between frameworks
Teams rarely migrate frameworks for fun; it is usually driven by a specific performance ceiling, a hiring need, or a codebase that has outgrown its original structure. Here is the realistic path for each direction.
Migrating from Express to Fastify
Fastify’s official @fastify/express compatibility plugin lets a team mount existing Express middleware inside a Fastify application, which means the migration does not have to happen in one big-bang rewrite. The practical sequence: install Fastify alongside the existing Express app, wrap Express middleware with the compatibility layer for routes that are not performance-critical, then rewrite the highest-traffic routes natively in Fastify with JSON Schema validation to capture the throughput gain where it matters most. Route-by-route migration like this typically takes a small team two to six weeks depending on how much custom Express middleware needs to be ported versus wrapped.
// Fastify route with JSON Schema validation replacing an Express + Joi route
const schema = {
body: {
type: 'object',
required: ['email', 'password'],
properties: {
email: { type: 'string', format: 'email' },
password: { type: 'string', minLength: 8 }
}
}
}
fastify.post('/login', { schema }, async (request, reply) => {
const { email, password } = request.body
return { token: await authenticate(email, password) }
})
Migrating from Express to NestJS
Moving from Express to NestJS is a bigger structural jump because it means adopting modules, controllers, providers, and dependency injection rather than swapping a routing library. The NestJS CLI can scaffold a new project structure, and existing Express route handlers typically become NestJS controller methods with minimal logic changes, but the surrounding service layer, validation, and dependency wiring all need to be rebuilt around Nest’s conventions. Since NestJS 11 defaults to the Express v5 adapter, teams can keep using Express-specific middleware during the transition without switching the underlying HTTP engine, and only move to the Fastify adapter afterward if throughput becomes a priority.
// NestJS controller with a built-in ValidationPipe, replacing an Express route + middleware
import { Controller, Post, Body, UsePipes, ValidationPipe } from '@nestjs/common'
class LoginDto {
email: string
password: string
}
@Controller('auth')
export class AuthController {
constructor(private readonly authService: AuthService) {}
@Post('login')
@UsePipes(new ValidationPipe())
async login(@Body() dto: LoginDto) {
return this.authService.authenticate(dto.email, dto.password)
}
}
Migrating a NestJS app from the Express adapter to the Fastify adapter
This is the lowest-risk migration of the three because the application’s controllers, services, and module structure do not change at all; only the platform adapter swaps from @nestjs/platform-express to @nestjs/platform-fastify. The main work is auditing any code that directly references the underlying Express Request or Response objects, since those APIs differ under Fastify, and re-testing any middleware that was Express-specific. Teams that made this switch in the 2026 benchmarks cited above saw NestJS throughput jump from roughly 33,000 req/s on the Express adapter to roughly 41,000 req/s on the Fastify adapter on the same hardware, without touching business logic.
Five real-world use cases and which framework fits
Framework choice should follow the shape of the workload, not a general preference. Here are five concrete scenarios and the reasoning behind each recommendation.
- High-traffic public REST API for a consumer app: Fastify. The req/s advantage compounds directly into lower infrastructure cost at scale, and built-in JSON Schema validation catches malformed requests before they burn compute cycles.
- Internal admin tool or CRUD backend for a small startup: Express. The team almost certainly already knows it, the ecosystem has a middleware for everything needed, and throughput is never going to be the bottleneck for an internal tool with a few hundred daily users.
- Enterprise platform with 15+ backend engineers and multiple bounded contexts: NestJS. The enforced module structure and dependency injection prevent the codebase entropy that tends to hit large unstructured Express or Fastify apps once headcount grows past a certain point.
- Serverless functions on AWS Lambda or Cloudflare Workers with strict cold-start budgets: Fastify or plain Express, given their sub-400ms average cold starts against NestJS’s roughly 815ms in 2026 benchmark data; if the team wants Nest’s structure anyway, the Fastify adapter is the better of the two Nest options here.
- Microservices architecture needing built-in support for gRPC, Kafka, or message queues: NestJS, whose
@nestjs/microservicespackage ships first-party transport layers for these protocols that neither Express nor Fastify provides out of the box.
Pros and cons: Express
Pros: the largest ecosystem and hiring pool of any Node.js framework, over fifteen years of production hardening, minimal learning curve, and middleware available for virtually any integration need. Cons: no built-in TypeScript types, no built-in validation or dependency injection, and the lowest raw throughput of the three in every benchmark cited above, meaning high-traffic services will need more compute instances to hit the same req/s ceiling as Fastify.
Pros and cons: Fastify
Pros: the highest throughput of the three across every 2026 benchmark referenced, built-in JSON Schema validation with genuine security benefits, first-class TypeScript support with multiple type-provider options, and an Express compatibility layer that de-risks migration. Cons: a smaller plugin ecosystem than Express (roughly half the GitHub star count and a fraction of the weekly downloads), and no built-in dependency injection for teams that want enforced architecture at scale.
Pros and cons: NestJS
Pros: enforced module structure and dependency injection that scales cleanly with team size, first-party support for GraphQL, microservices transports, and WebSockets, and the flexibility to run on either the Express or Fastify adapter depending on throughput needs. Cons: the steepest learning curve of the three (two to four weeks for an experienced Express developer, per 2026 CTO guidance), the highest cold-start time of the three in serverless contexts, and more boilerplate for small, simple APIs where the structure buys nothing.
GraphQL and API style flexibility
REST is not the only API style these frameworks need to support, and GraphQL adoption is a good stress test of how “batteries included” each one really is. Express and Fastify both require a separate GraphQL server library, most commonly Apollo Server or Mercurius (Fastify’s own GraphQL adapter, built specifically to take advantage of Fastify’s plugin encapsulation and JSON Schema pipeline), wired in as an additional layer on top of the base HTTP server. NestJS ships an official @nestjs/graphql module that generates a GraphQL schema directly from the same decorators used for REST resolvers, so a team can expose the same underlying service through both REST controllers and GraphQL resolvers without duplicating business logic, a pattern that is considerably more manual to set up correctly in Express or Fastify.
This does not make NestJS the automatic choice for a GraphQL-first API. Mercurius on Fastify has its own throughput advantages for GraphQL specifically, since it can reuse Fastify’s JSON Schema validation for GraphQL variable validation, and plenty of high-performance GraphQL gateways are built on Fastify plus Mercurius for exactly that reason. The decision comes down to the same tradeoff as everywhere else in this comparison: NestJS trades some raw throughput for a schema-code-generation workflow that keeps REST and GraphQL definitions from drifting apart, while Fastify keeps the performance ceiling higher for teams willing to manage that consistency by hand.
The verdict: which one should you actually pick
There is no single winner here, and any comparison that claims otherwise is oversimplifying. The data supports three distinct, defensible choices depending on what a team is optimizing for. If raw requests-per-second and built-in schema validation matter most, Fastify wins on every 2026 benchmark cited in this piece, typically by a factor of 1.5x to 2x over Express on equivalent hardware. If hiring speed, ecosystem breadth, and minimal onboarding time matter most, Express remains the safer default, backed by roughly nine times Fastify’s weekly npm downloads and a middleware for nearly anything a team might need. If a growing engineering team needs architectural guardrails that survive turnover and scale past a handful of engineers, NestJS is worth its steeper learning curve and heavier cold start, especially since it lets teams swap in the Fastify adapter later without touching business logic.
For most new projects starting from scratch in late 2026 with no strong constraint either way, Fastify is the more future-proof default: it delivers Express-level developer ergonomics with meaningfully better throughput and validation built in, and its official Express compatibility plugin removes most of the migration risk that used to make Fastify a harder sell.
Frequently asked questions
Is Fastify actually faster than Express in production, not just benchmarks?
Yes, based on the 2026 sources cited above, including Fastify’s own October 2026 benchmark refresh showing Fastify 5.12.5 roughly 1.8x faster than Express 5.2.1 (50,373 req/s versus 27,474 req/s, with 19.33 ms versus 35.89 ms average latency), though the real-world gap is usually smaller than synthetic hello-world benchmarks suggest, since production APIs spend time on database calls and business logic that both frameworks handle identically.
Can NestJS use Fastify instead of Express?
Yes. NestJS supports Fastify as an alternative HTTP adapter via the @nestjs/platform-fastify package, and 2026 benchmark data shows this configuration narrowing NestJS’s throughput gap with plain Fastify significantly compared to the default Express adapter.
Is Express dead in 2026?
No, but its growth has slowed. Express still leads every framework in weekly npm downloads by a wide margin, though a large share of that volume comes from existing production codebases rather than new project starts, based on 2026 ecosystem analysis.
Which framework is best for beginners learning Node.js backend development?
Express, because its middleware model is the simplest to reason about and it has the largest volume of tutorials, Stack Overflow answers, and course material of the three.
Does NestJS require using TypeScript?
NestJS is written in and designed around TypeScript, and while it technically supports plain JavaScript, its decorator-based dependency injection system is significantly harder to use correctly without TypeScript’s type checking.
How hard is it to migrate an existing Express app to Fastify?
Fastify’s official @fastify/express compatibility plugin allows existing Express middleware to run inside a Fastify app, which means migration can happen incrementally, route by route, rather than requiring a full rewrite before deployment.
Do I need a separate validation library with Fastify?
No. Fastify includes JSON Schema validation via Ajv out of the box, compiling schemas into optimized validation functions at startup, which is different from Express, where developers typically add Zod or Joi as a separate dependency.
Which framework has better serverless cold-start performance?
Express and Fastify are close, at roughly 379ms and 390ms average cold start respectively in 2026 benchmark data, while NestJS trails at roughly 815ms due to its dependency injection container needing to resolve the full module graph on every cold boot.





