Node.js has four mainstream HTTP frameworks: Express (the default, the broadest middleware support), Fastify (the faster, schema-validated, plugin-based), Koa (the minimalist, async-first, pick-everything-yourself), and Hapi (the configuration-driven, batteries-included). The right answer is Fastify for a new project that needs performance, Express for a team that wants the broadest middleware support, Koa for a team that wants to pick every dependency, Hapi for a team that wants the configuration-driven model. The mistake every team makes: the team picks the framework with the most GitHub stars (Express) and finds the team’s actual needs are better served by a smaller, focused framework.
Table of contents
- Express — the default
- Fastify — the faster, schema-validated
- Koa — the minimalist, async-first
- Hapi — the configuration-driven
- The performance — Fastify wins on hello-world, Express wins on familiarity
- The plugin story — Express has middleware, Fastify has plugins, Koa has nothing built in
- The right choice for 2026
- How this fits the rest of the stack
- FAQ
Express — the default
Express is the default Node.js framework. The API is minimal (a router, a request, a response, a next), the middleware ecosystem is the largest in the Node.js world (every auth library, every body parser, every rate limiter has an Express middleware), the team can find an answer to any question on Stack Overflow. The right answer is Express for a team that wants the broadest middleware support, a team that is porting a non-Node app to Node, or a team that values familiarity over performance.
The gotcha: Express is slower than Fastify (2-3x on the hello-world benchmark, more on production workloads), and the API is showing its age (the req/res API is from 2010, the async story is bolted on with express-async-handler). The right answer is Express for a team that needs the middleware ecosystem, Fastify for a team that needs the performance.
Fastify — the faster, schema-validated
Fastify is the faster, schema-validated, plugin-based Node.js framework. The request lifecycle is hooks-based (onRequest, preHandler, handler), the schema is JSON Schema (the request body, the response body, the query string are all validated), the plugin model is the right answer for a team that wants to split a large app into plugins. The right answer is Fastify for a new project that needs performance, a team that wants the schema-validated request/response, or a team that wants the plugin model.
The gotcha: Fastify’s middleware ecosystem is smaller than Express’s, and the team that needs a specific Express middleware may need to write a Fastify hook. The right answer is Fastify for a new project, the wrong answer is to migrate a large Express app to Fastify — the migration is expensive, and the team’s existing middleware is the main reason the team picked Express.
Koa — the minimalist, async-first
Koa is the minimalist, async-first Node.js framework. The core is a request handler chain (await next()), the team picks every dependency (body parser, router, logger, error handler), the team builds the framework. The right answer is Koa for a team that wants to pick every dependency, a team that values a small core, or a team that needs the async story (the team writes async/await everywhere, no callbacks).
The gotcha: Koa is the smallest core, which means the team builds the most. The right answer is Koa for a team that wants the small core and is willing to add the dependencies. The wrong answer is Koa for a team that wants batteries-included — the team is paying for the small core with a longer setup.
Hapi — the configuration-driven
Hapi is the configuration-driven, batteries-included Node.js framework. The team configures the server, the routes, the plugins, the auth in a single object. The right answer is Hapi for a team that wants the configuration-driven model, a team that values the explicit over the implicit, or a team that has been on Hapi for years and is not migrating.
The gotcha: Hapi’s community is smaller than Express’s, and the team’s specific middleware may not have a Hapi equivalent. The right answer is Hapi for a team that has been on Hapi, the wrong answer is Hapi for a new project that needs the broadest middleware support.
The performance — Fastify wins on hello-world, Express wins on familiarity
The hello-world benchmark: Fastify handles ~75K req/sec, Express handles ~25K req/sec, Koa handles ~50K req/sec, Hapi handles ~30K req/sec. The right answer is Fastify for the team’s performance-critical endpoint, the wrong answer is to pick the framework based on the hello-world benchmark — the team’s actual workload has business logic, database calls, and external API calls, and the framework is 5-10% of the total response time.
The plugin story — Express has middleware, Fastify has plugins, Koa has nothing built in
Express has middleware. The team writes a function that takes (req, res, next), the function does something, calls next(), the next middleware runs. The right answer is middleware for a team that wants the most common pattern.
Fastify has plugins. The team writes a function that takes (fastify, opts, next), the function decorates the fastify instance, the plugin is registered with fastify.register(plugin). The right answer is plugins for a team that wants the encapsulation model, the wrong answer is plugins for a team that is used to Express middleware.
Koa has nothing built in. The team picks the body parser, the router, the logger. The right answer is the small core for a team that wants to pick every dependency, the wrong answer is the small core for a team that wants batteries-included.
The right choice for 2026
The right answer for a new project in 2026 is Fastify. The framework is the fastest of the four, the schema-validated request/response catches bugs at the edge, the plugin model is the right abstraction for a growing app.
The right answer for an existing Express app is to stay on Express. The migration cost is high, the team has the middleware ecosystem, the framework is not the bottleneck. The wrong answer is to migrate a stable Express app to Fastify for a 2x performance improvement that the team will not measure.
How this fits the rest of the stack
The infrastructure question is a small piece of a larger pattern: the team’s runtime, storage, database, secret store, logs, and deployment platform are all parts of the same platform. The right answer is to model the full stack before the project ships, not after. The RunxBuild hosting calculator is the right place to do that exercise — pick the runtime, the memory tier, the storage, the secret store, and the egress, and the calculator shows what the deploy actually costs at the team’s actual usage.
Useful related references:
FAQ
What is the best Node.js framework in 2026?
Fastify for a new project that needs performance, Express for a team that wants the broadest middleware support, Koa for a team that wants to pick every dependency, Hapi for a team that wants the configuration-driven model.
Is Express still relevant in 2026?
Yes. Express is the right answer for a team that wants the broadest middleware support, a team that is porting a non-Node app to Node, or a team that values familiarity over performance.
Is Fastify faster than Express?
Yes — Fastify is 2-3x faster on the hello-world benchmark, more on production workloads. The right answer is Fastify for the team’s performance-critical endpoint.
What is the difference between Express and Koa?
Express is the default with the broadest middleware support. Koa is the minimalist, async-first, pick-everything-yourself. The right answer is Express for the team’s first Node.js project, Koa for the team that wants the small core.
Should I use Hapi in 2026?
Hapi is the right answer for a team that has been on Hapi for years and is not migrating. The wrong answer is Hapi for a new project that needs the broadest middleware support.
What is the best framework for a microservices system?
Fastify for performance, Express for familiarity, Koa for a small core. The right answer is the framework that the team’s existing services use, so the team does not have to maintain two frameworks.
How do I add auth to Express?
npm install passport, configure the strategy (JWT, OAuth, etc.), use passport.authenticate as a middleware. The right answer is Passport for a team that wants the broadest strategy support, express-jwt for a team that only needs JWT.
How do I add a body parser to Express?
express.json() and express.urlencoded() are built-in (since Express 4.16). The right answer is the built-in parser for JSON and URL-encoded bodies, multer for multipart/form-data.