Backend Engineering

How Hono and Elysia Are Challenging Express and Fastify

R

TL;DR: The JavaScript backend landscape is splitting into two generations. Express and Fastify dominate Node.js with massive ecosystems and battle-tested stability. Hono and Elysia represent the new wave—built on Web Standards, optimized for edge/serverless, and designed for TypeScript-first development. This guide compares all four frameworks with benchmarks, code examples, and practical guidance on when to use each.

The Generational Divide

Something fundamental is shifting in JavaScript backend development. For over a decade, Express defined how we build Node.js servers. Fastify modernized that approach with better performance and built-in validation. But both are built on Node.js’s proprietary HTTP APIs—APIs that diverge significantly from how browsers handle requests.

Enter the new generation. Hono and Elysia are built on Web Standards (the Fetch API and WinterCG specification), the same APIs that power Cloudflare Workers, Deno, and modern browsers. This isn’t just a technical footnote—it fundamentally changes where and how your code can run.

The old guard runs on Node.js. The new wave runs everywhere.

The Incumbents

Express: The Universal Standard

Express has powered Node.js web development since 2010. It provides routing, middleware support, and request handling—then gets out of your way.

const express = require('express')
const app = express()

app.use(express.json())

app.get('/', (req, res) => {
  res.send('Hello World')
})

app.post('/users', (req, res) => {
  const { name, email } = req.body
  // No built-in validation
  res.json({ id: 1, name, email })
})

app.listen(3000)

Strengths:

  • ~47 million weekly npm downloads
  • Massive middleware ecosystem
  • Every Node.js developer knows it
  • Solutions exist for virtually every problem
  • 14 years of production battle-testing

Weaknesses:

  • No built-in validation or serialization
  • Predates async/await (error handling is clunky)
  • Slowest performer in benchmarks
  • No native TypeScript support

Fastify: The Performance Upgrade

Fastify arrived in 2016 as the “faster Express” with built-in schema validation, optimized JSON handling, and a robust plugin architecture.

const fastify = require('fastify')()

fastify.post('/users', {
  schema: {
    body: {
      type: 'object',
      required: ['name', 'email'],
      properties: {
        name: { type: 'string' },
        email: { type: 'string', format: 'email' }
      }
    },
    response: {
      200: {
        type: 'object',
        properties: {
          id: { type: 'number' },
          name: { type: 'string' },
          email: { type: 'string' }
        }
      }
    }
  }
}, async (request, reply) => {
  const { name, email } = request.body
  return { id: 1, name, email }
})

fastify.listen({ port: 3000 })

Strengths:

  • 2-3x faster than Express
  • Built-in JSON Schema validation
  • Excellent plugin ecosystem (rate limiting, auth, OpenTelemetry)
  • Native async/await support
  • Great documentation and active community

Weaknesses:

  • Still Node.js only
  • Larger learning curve than Express
  • Schema definitions are verbose

The Challengers

Hono: The Multi-Runtime Champion

Hono (meaning “flame” in Japanese) is designed for the modern deployment landscape. The same code runs on Cloudflare Workers, Deno, Bun, AWS Lambda, Vercel Edge, and Node.js.

import { Hono } from 'hono'
import { validator } from 'hono/validator'

const app = new Hono()

app.get('/', (c) => c.text('Hello World'))

app.post('/users',
  validator('json', (value, c) => {
    const { name, email } = value
    if (!name || !email) {
      return c.json({ error: 'Invalid input' }, 400)
    }
    return { name, email }
  }),
  (c) => {
    const { name, email } = c.req.valid('json')
    return c.json({ id: 1, name, email })
  }
)

export default app

Strengths:

  • Runs on any JavaScript runtime
  • Under 14KB bundle size (perfect for edge)
  • Minimal cold start times
  • Growing rapidly (~2.7M weekly downloads)
  • First-party OpenAPI support

Weaknesses:

  • Smaller ecosystem than Fastify
  • Validation is less elegant than Elysia
  • 4 years old (younger than incumbents)

Elysia: The Type Safety Pioneer

Elysia is built for Bun and takes TypeScript integration further than any competitor. Its killer feature is Eden—end-to-end type safety between server and client without code generation.

// server.ts
import { Elysia, t } from 'elysia'

const app = new Elysia()
  .get('/', () => 'Hello World')
  .post('/users', ({ body }) => ({
    id: 1,
    ...body
  }), {
    body: t.Object({
      name: t.String(),
      email: t.String({ format: 'email' })
    })
  })
  .listen(3000)

export type App = typeof app
// client.ts
import { treaty } from '@elysiajs/eden'
import type { App } from './server'

const api = treaty<App>('localhost:3000')

// Full TypeScript autocompletion and type checking
const { data } = await api.users.post({
  name: 'Ada',
  email: 'ada@example.com'
})
// data is typed as { id: number, name: string, email: string }

Strengths:

  • Best-in-class type safety (Eden)
  • Fastest benchmarks (21x Express on Bun)
  • Automatic OpenAPI generation
  • Elegant validation syntax
  • Supports Zod, Valibot, ArkType via Standard Schema

Weaknesses:

  • Node.js support is experimental
  • Smallest ecosystem (~154K weekly downloads)
  • Only 1.5 years since v1.0
  • Tied to Bun for best experience

Head-to-Head Benchmarks

Performance varies by benchmark methodology, but the general ranking is consistent:

TechEmpower Round 22 (requests/second, plaintext):

Framework

Requests/sec

Relative to Express

Elysia (Bun)

2,454,631

21.7x

Hono (Bun)

~800,000

~7x

Fastify (Node)

415,600

3.7x

Express (Node)

113,117

1x (baseline)

Important caveats:

  • Real applications are bottlenecked by databases and external APIs, not framework overhead
  • Bun vs Node runtime accounts for much of the difference
  • “Hello World” benchmarks don’t reflect production complexity

As one developer put it: “If you are picking your framework purely based on ‘speed’ then there is something deeply wrong with your process.”

When to Use What

Choose Express When:

  • You need maximum ecosystem compatibility
  • Your team knows Express and hiring is a priority
  • You’re maintaining or extending existing Express apps
  • You want the most Stack Overflow answers available

Choose Fastify When:

  • You need better performance than Express on Node.js
  • Built-in validation and serialization matter
  • You want a mature plugin ecosystem (OpenTelemetry, rate limiting, etc.)
  • You’re migrating from Express (use @fastify/express for incremental migration)

Choose Hono When:

  • You deploy to edge/serverless (Cloudflare Workers, Vercel Edge, Deno Deploy)
  • You need the same code to run on multiple runtimes
  • Bundle size and cold starts are critical
  • You want modern DX without committing to Bun

Choose Elysia When:

  • You’re building on Bun and want maximum performance
  • End-to-end type safety is a priority (Eden)
  • You’re building full-stack TypeScript applications
  • Automatic OpenAPI documentation matters
  • Your team is comfortable with cutting-edge tooling

The Practical Decision Framework

Ask yourself these questions:

1. Where are you deploying?

  • Traditional Node.js server → Fastify or Express
  • Edge/Serverless (Cloudflare, Vercel Edge) → Hono
  • Bun server → Elysia

2. How important is ecosystem maturity?

  • Critical (enterprise, regulated industry) → Express or Fastify
  • Moderate (startup, internal tools) → Hono
  • Willing to pioneer → Elysia

3. What’s your TypeScript situation?

  • JavaScript or light TypeScript → Express or Fastify
  • TypeScript-first, multi-runtime → Hono
  • TypeScript maximalist, full-stack → Elysia

4. How risk-tolerant is your team?

  • Conservative → Express
  • Moderate → Fastify or Hono
  • Progressive → Elysia

Migration Paths

Express → Fastify

Fastify provides @fastify/express for incremental migration. You can wrap your existing Express app and migrate route-by-route.

Express → Hono

Hono’s API is similar enough that migration is straightforward, but there’s no compatibility layer. Plan for a rewrite.

Anything → Elysia

Elysia requires Bun for production use. This is a runtime change, not just a framework change. Evaluate Bun readiness first.

The Honest Trade-offs

Factor

Express

Fastify

Hono

Elysia

npm Downloads

47M/week

3M/week

2.7M/week

154K/week

GitHub Stars

~68K

~35K

~27K

~14K

Stack Overflow Answers

Abundant

Good

Limited

Sparse

Production Years

14

8

4

1.5

Hiring Pool

Huge

Large

Growing

Niche

Breaking Changes Risk

Low

Low

Medium

Higher

The Bottom Line

The JavaScript backend world is bifurcating:

If you’re building for Node.js servers, Fastify is the modern choice. It offers meaningful performance improvements over Express with a mature ecosystem and straightforward migration path.

If you’re building for edge/serverless or multi-runtime, Hono is the pragmatic choice. It’s lightweight, fast, and runs everywhere JavaScript runs.

If you’re all-in on Bun and TypeScript, Elysia offers capabilities no other framework matches—particularly Eden’s end-to-end type safety. But you’re adopting two cutting-edge technologies simultaneously.

If you need maximum stability and ecosystem, Express remains the safe choice. It’s not exciting, but it works, and everyone knows it.

The challengers aren’t just faster—they’re built for a different world. Whether that world is yours depends on where you deploy, how you code, and how much risk you’re willing to accept.

Resources

Express

Fastify

Hono

Elysia

Discussion

Loading discussion...

Comments are closed for this post.