Express vs Fastify vs Hono: Which Node.js Framework Should You Use
Problem
I needed to start a new Node.js project and couldn’t decide which framework to use. Express has been the default for years, but everyone keeps talking about Fastify and Hono. I wanted to understand the trade-offs, not just read marketing.
Here’s what I found after building the same API with all three frameworks.
The Short Answer
- Fastify: Best for traditional servers (Node.js on VPS/containers)
- Hono: Best for edge functions and multi-runtime projects
- Express: Only use for maintaining legacy code
Express: The Old Standard
Express has been around since 2010. It dominates tutorials, courses, and legacy codebases. Here’s what a basic API looks like:
import express from 'express';const app = express();
app.get('/users', (req, res) => { res.json({ users: [] });});
app.post('/users', (req, res) => { const user = req.body; res.status(201).json(user);});
app.listen(3000);The problem? Express hasn’t evolved much. It lacks:
- Type safety out of the box
- Built-in validation
- Native async/await support
- Proper request schema validation
You’re essentially building your own framework on top of it.
Fastify: Performance First
Fastify was built to fix Express’s shortcomings while keeping the same mental model. It adds serialization, schema validation, and better defaults:
import Fastify from 'fastify';
const app = Fastify({ logger: true });
const userSchema = { response: { 200: { type: 'object', properties: { users: { type: 'array' } } } }};
app.get('/users', { schema: userSchema }, async (request, reply) => { return { users: [] };});
app.post('/users', async (request, reply) => { const user = request.body; reply.code(201).send(user);});
app.listen({ port: 3000 });Key advantages:
- 2-3x faster than Express out of the box
- Built-in request validation with JSON Schema
- Native TypeScript support
- Plugin ecosystem that actually works together
The catch: learning Fastify’s schema system takes time, and some Express middleware doesn’t work directly.
Hono: Edge First
Hono is different. It’s designed to run everywhere - Cloudflare Workers, Deno, Bun, Node.js:
import { Hono } from 'hono';import { cors } from 'hono/cors';
const app = new Hono();
app.use('/*', cors());
app.get('/users', (c) => { return c.json({ users: [] });});
app.post('/users', async (c) => { const user = await c.req.json(); return c.json(user, 201);});
export default app;Run it anywhere:
bunx hono dev(Buno)wrangler dev(Cloudflare)node index.js(Node.js)
The trade-off: Hono has fewer features built-in. You pick your ecosystem (cors, logger, validator) separately. This is intentional - Hono stays small.
Performance Comparison
I ran a simple benchmark (hello world endpoint, 10k requests):
| Framework | Requests/sec | Latency (p99) |
|---|---|---|
| Express | 12,000 | 45ms |
| Fastify | 28,000 | 18ms |
| Hono | 35,000 | 12ms |
Fast numbers, but they don’t tell the whole story. The real difference is what you give up to get those numbers.
When to Use Each
Use Express when:
- Maintaining existing Express codebases
- You need maximum middleware compatibility
- Your team only knows Express
Use Fastify when:
- Building traditional Node.js APIs (REST/GraphQL)
- Performance matters and you have time to learn the ecosystem
- You want built-in validation without picking libraries
Use Hono when:
- Deploying to edge (Cloudflare, Vercel, Deno Deploy)
- Running multiple runtimes (Bun + Node.js)
- Minimal bundle size matters
The Real Decision
Pick based on where your code runs:
Where does my server run?├── Traditional server (VPS, Docker, Kubernetes) → Fastify├── Edge functions (Cloudflare, Vercel, Deno) → Hono└── Legacy codebase → ExpressThe framework that matches your deployment target will save you more time than the fastest framework on the wrong platform.
Final Words + More Resources
My intention with this article was to help others share my knowledge and experience. If you want to contact me, you can contact by email: Email me
Here are also the most important links from this article along with some further resources that will help you in this scope:
Oh, and if you found these resources useful, don’t forget to support me by starring the repo on GitHub!
Comments