Encore, Fastify, NestJS, Hono and Elysia ranked for TypeScript teams moving off Express, with code and current versions

The best Express alternative in 2026 is Encore, an open source backend framework with built-in infrastructure: you define type-safe APIs, Postgres databases, Pub/Sub topics and cron jobs in TypeScript, encore run starts them locally, and a deploy provisions them in your own AWS or GCP account. Fastify is the closest drop-in upgrade, NestJS suits large teams that want strict structure, Hono suits edge runtimes and Elysia suits Bun.
Express has been the default Node.js framework for over 15 years, and Express 5.3.0 is still where a lot of Node.js backends start. It gives you routing and middleware and stops there, so request validation, TypeScript types, tracing and every database or queue connection come from libraries you pick and wire yourself, and the cloud resources behind them come from Terraform or someone else's ticket queue.
The five alternatives below differ mainly in how much of that they take on. For a broader comparison, see our Best TypeScript Backend Frameworks guide.
Encore is an open source backend framework for TypeScript and Go with built-in infrastructure, and it deploys to your own AWS or GCP account. Where an Express app gets validation from Zod, a pool from pg, a queue client from the AWS SDK and tracing from OpenTelemetry, an Encore app gets all four from the framework: the request type is the validation, the database and topic are declared in the service, and every request is traced. If you would rather run it yourself, encore build docker exports a standard Docker image.
Encore runs on a Rust-based runtime that handles HTTP parsing, validation, and I/O outside the Node.js event loop. In benchmarks, Encore handles more requests per second than Express, and a production backend also needs less code and configuration.
import { api, APIError } from "encore.dev/api";
import { SQLDatabase } from "encore.dev/storage/sqldb";
const db = new SQLDatabase("users", { migrations: "./migrations" });
interface User {
id: number;
name: string;
email: string;
}
export const getUser = api(
{ method: "GET", path: "/users/:id", expose: true },
async ({ id }: { id: number }): Promise<User> => {
const user = await db.queryRow<User>`SELECT id, name, email FROM users WHERE id = ${id}`;
if (!user) throw APIError.notFound("user not found");
return user;
}
);
The Express version of that endpoint needs a validation library, a connection pool, error-handling middleware and tracing instrumentation before it does the same thing, and each new endpoint repeats the validation and error wiring. In Encore the TypeScript types are checked at runtime, encore run starts the users database locally and applies the migrations, and the same declaration becomes RDS or Cloud SQL when you deploy.
Cron jobs and buckets work the same way, and a nightly export that Express would run from a separate scheduler is a declaration next to the endpoint it calls:
import { api } from "encore.dev/api";
import { CronJob } from "encore.dev/cron";
import { Bucket } from "encore.dev/storage/objects";
const userExports = new Bucket("user-exports", { versioned: false });
export const exportUsers = api({}, async (): Promise<void> => {
const csv = "id,name,email\n"; // build the CSV from the users table
const day = new Date().toISOString().slice(0, 10);
await userExports.upload(`users-${day}.csv`, Buffer.from(csv), { contentType: "text/csv" });
});
const _ = new CronJob("export-users", {
title: "Export users to object storage",
schedule: "0 2 * * *",
endpoint: exportUsers,
});
Cron jobs do not run on their schedule locally or in preview environments, so you call exportUsers directly to test it. In production the bucket is S3 or Cloud Storage in your account and the schedule is managed by the Encore platform.
The biggest shift is declaring resources instead of configuring them: you write new SQLDatabase("users", { migrations: "./migrations" }) and encore run starts Postgres locally with the migrations applied, with no connection string or setup script.
In Express, calling another service means making HTTP requests with manually constructed URLs. In Encore, you import a function from another service and call it. Encore handles service discovery, serialization and tracing.
Built-in distributed tracing shows you how requests flow through your system without configuring OpenTelemetry, Jaeger or other external tools. Encore also generates a service catalog with API documentation that stays in sync with your code, with no separate OpenAPI spec to maintain.
Yes. Encore works alongside Express, and the Express migration guide mounts an existing Express app under a catch-all raw endpoint, so every route keeps working while you move endpoints over one at a time:
import { api, RawRequest, RawResponse } from "encore.dev/api";
import express, { request, response } from "express";
Object.setPrototypeOf(request, RawRequest.prototype);
Object.setPrototypeOf(response, RawResponse.prototype);
const app = express();
app.get("/hello", (_req, res) => {
res.send("Hello from Express");
});
// Every request Encore does not route elsewhere goes to the Express app.
export const expressApp = api.raw(
{ expose: true, method: "*", path: "/!rest" },
app,
);
Routes behind the catch-all do not get full per-endpoint tracing or generated clients until they move to Encore APIs.
Encore asks you to follow its conventions for APIs and infrastructure, which keeps projects consistent as they grow and is a bigger change than swapping one HTTP framework for another. Standard npm packages work alongside Encore's built-in primitives for anything Encore does not cover.
Consider Encore when the backend is going to production with a database, queues or scheduled jobs, or when several services need to call each other with typed requests and tracing from the first deploy. It also fits teams where AI coding agents write part of the backend, because an agent that needs a new table or topic declares it in the same change and can run it locally before review.
For a detailed head-to-head, see our Express.js vs Encore comparison.
Install the CLI with brew install encoredev/tap/encore && encore app create:
Run in your terminal to get started locally.
See the Encore TypeScript documentation for more details, follow the REST API tutorial to build a complete application, or check out Encore AI Integration for using Encore with AI coding agents.
Fastify was started in 2016 to cut the request overhead that Express, Restify, Hapi and Koa added, while adding a plugin system and JSON Schema validation. It uses JSON Schema for request and response validation, which provides both runtime checking and serialization optimization. The plugin architecture encourages clean separation of concerns, with each plugin managing its own dependencies and lifecycle.
For Express users, Fastify feels familiar enough that the migration is straightforward. Routes look similar, middleware translates to plugins, and the async/await support is first-class. The main adjustment is learning the JSON Schema validation layer and the plugin lifecycle. The migration path is well documented, including patterns for converting middleware.
import Fastify from 'fastify';
const fastify = Fastify({ logger: true });
fastify.get('/users/:id', {
schema: {
params: {
type: 'object',
properties: {
id: { type: 'string' }
}
},
response: {
200: {
type: 'object',
properties: {
id: { type: 'string' },
name: { type: 'string' },
email: { type: 'string' }
}
}
}
}
}, async (request) => {
return getUserById(request.params.id);
});
fastify.listen({ port: 3000 });
Fastify gives you more structure than Express without being as opinionated as NestJS. The JSON Schema validation catches bad requests before they reach your handler code, and the same schemas can generate OpenAPI documentation. Performance is better than Express, and the plugin system provides a clean way to organize middleware and shared functionality.
JSON Schema definitions are verbose, and for complex request/response types the schema can be longer than the handler code itself. You can use TypeBox to write schemas in TypeScript, but that is an additional layer. Like Express, Fastify does not manage infrastructure, observability, or service discovery. You are still responsible for configuring databases, setting up tracing, and managing deployment.
Consider Fastify when you want a structured upgrade from Express with JSON Schema validation and plugins, especially for a single-service API that needs more throughput than Express.
For a deeper comparison, see our Fastify vs Encore article.
NestJS takes the opposite approach from Express: where Express is minimal and unopinionated, NestJS enforces a strict architecture inspired by Angular. Modules, controllers, providers, guards, interceptors, and pipes give you a comprehensive toolkit for building applications with consistent patterns across the codebase.
The dependency injection system is the core of NestJS's design. Every service is injectable, making unit testing straightforward and encouraging loose coupling. For teams coming from Express who struggled with inconsistent code organization as the project grew, NestJS provides the guardrails that Express deliberately avoids. The framework has a large community and extensive documentation, with solutions for GraphQL, WebSockets, microservices, task scheduling and other use cases.
import { Controller, Get, Param } from '@nestjs/common';
import { UsersService } from './users.service';
@Controller('users')
export class UsersController {
constructor(private readonly usersService: UsersService) {}
@Get(':id')
findOne(@Param('id') id: string) {
return this.usersService.findOne(id);
}
}
NestJS scales well across a large team: with 10+ developers working on the same backend, the enforced architecture means everyone follows the same patterns. New team members can find their way around the codebase because modules, controllers, and services always look the same. The comprehensive feature set covers GraphQL, WebSockets, task scheduling, and more without reaching for external libraries.
The learning curve is the steepest on this list, and even experienced Express developers need time to internalize modules, custom decorators, guards, interceptors, and the DI container. The decorator-heavy code can obscure what is happening at runtime, making debugging harder. For small teams or simple APIs, the overhead is not worth it. And despite having microservices support, you still configure infrastructure, tracing, and deployment yourself.
Consider NestJS for large applications with many contributors where consistent architecture matters more than simplicity, especially if the team knows Angular.
For a detailed comparison, see our NestJS vs Encore article.

Hono takes the minimalism that made Express popular and updates it for modern JavaScript runtimes. It runs on Cloudflare Workers, Deno, Bun, and Node.js with the same API. The framework is small, fast, and includes enough built-in middleware to handle common requirements without a sprawling dependency tree.
For Express users who liked the simplicity but want better TypeScript support and runtime flexibility, Hono is the most natural transition. The routing API and middleware work much like Express. Hono started as a Cloudflare Workers framework and has grown in adoption on Workers and other edge platforms, where Cloudflare uses it in products such as Workers Logs, D1, KV and Queues, and where Express cannot run.
import { Hono } from 'hono';
import { zValidator } from '@hono/zod-validator';
import { z } from 'zod';
const app = new Hono();
app.get(
'/users/:id',
zValidator('param', z.object({ id: z.string() })),
async (c) => {
const { id } = c.req.valid('param');
const user = await getUserById(id);
return c.json(user);
}
);
export default app;
Hono keeps the simplicity of Express and adds native TypeScript support, and its runtime portability means you are not locked into Node.js. When deploying to Cloudflare Workers or similar edge platforms, Hono's tiny bundle size translates directly to faster cold starts and lower costs.
Like Express, Hono is focused on HTTP routing and middleware. It does not manage infrastructure, provide service discovery, or include built-in observability. For traditional server-side backends with databases and message queues, you will still need to configure everything yourself. The ecosystem is growing but still smaller than Express's.
Consider Hono for edge platforms and cross-runtime deployments, or for lightweight APIs where bundle size matters more than infrastructure automation.
For a deeper comparison, see our Hono vs Encore article.
Elysia is a TypeScript framework built for Bun. It keeps the small, route-first feel of Express, but adds schema validation and type inference directly into route definitions: you describe a request body with TypeBox, and Elysia validates it and types the handler from the same schema. Node.js compatibility exists, but Bun is the intended target.
Elysia also ships Eden, a type-safe client that gives your frontend end-to-end types from the server's route definitions without code generation. If you are moving off Express and already using Bun, Elysia is the most direct way to get validation and typed clients.
import { Elysia, t } from 'elysia';
const app = new Elysia()
.get('/users/:id', ({ params: { id } }) => getUser(id))
.post('/users', ({ body }) => createUser(body), {
body: t.Object({
email: t.String({ format: 'email' }),
name: t.String({ minLength: 1 }),
}),
})
.listen(3000);
Elysia removes most of the glue code Express needs for validation and typing. Request bodies, params, and responses are validated and typed from one schema, so there is no separate validation middleware or hand-written interfaces to keep in sync. Eden carries those types to the frontend, which shortens the loop between backend changes and client code.
Elysia is optimized for Bun, so teams standardized on Node.js get less out of it, and some Bun-specific APIs do not carry over. Its ecosystem is much smaller than Express's or Fastify's. Like the other HTTP frameworks here, it does not provide infrastructure management, distributed tracing, or type-safe service-to-service calls; Eden is designed for frontend-to-backend calls.
Consider Elysia when you are building on Bun and want validation, handler types and frontend types through Eden from one schema.
Encore works best, because it gives agents one way to define APIs and infrastructure. The TypeScript backend ecosystem has many valid ways to structure a project, and an agent working in an Express codebase with no conventions tends to pick a different validation library, database access pattern and error handling style from one prompt to the next.
With Encore, the project's API patterns, infrastructure declarations, and service structure are already defined. An agent reads the existing conventions and follows them, as each of those tasks has one defined pattern.
Encore also provides an MCP server and editor rules (encore llm-rules init) that give agents access to database schemas, distributed traces, and service architecture. Agents can then generate queries that match your tables and debug with request data from traces. Read more in How AI Agents Want to Write TypeScript.
Start at the top and follow the first question you can answer with a yes:
Do you want infrastructure provisioned from your code in your own AWS or GCP account?
Are you building several services that share databases, Pub/Sub, or cron jobs?
Do you need high request throughput from a Node.js backend?
Are you deploying to edge runtimes or serverless platforms like Cloudflare Workers?
HonoSmall bundles that run on any runtime
HonoSmall bundles that run on any runtimeIs a large team relying on strict architectural conventions?
Are you building on Bun and want end-to-end types with your frontend?
In more detail:
Encore addresses the most common complaints about Express, which are missing validation, missing observability, weak TypeScript integration and infrastructure that lives somewhere else, and it does so as one backend framework with built-in infrastructure that also runs about 9x faster in our benchmarks. Its conventions also give AI coding agents one set of patterns to follow in your project.
Fastify is a good step up from Express if you want JSON Schema validation and a plugin architecture while keeping a similar mental model. It does not solve infrastructure or observability, but it adds structure where Express has none.
NestJS fits large teams that need strict architectural conventions. The learning curve is steep, but the consistency pays off when many developers work on the same codebase.
Hono is the right choice for edge computing and serverless. It is Express-like in philosophy but built for modern runtimes and minimal bundle sizes.
Elysia suits teams building on Bun that want validation and types inferred from one schema, plus end-to-end type safety with the frontend through Eden. It does not address infrastructure or observability.
Verdict. Encore ranks first for teams moving a production backend off Express, since it covers validation, tracing, service calls and the databases, queues and cron jobs in your own cloud, and it can run your Express routes while you migrate. Fastify ranks second as the smallest step from Express, followed by NestJS for large teams, Hono for edge runtimes and Elysia for Bun. To try Encore, the Express migration guide starts with your current app mounted as a raw endpoint.
Evaluating your options? Join our Discord community to discuss framework choices with other TypeScript developers.
Encore is the best Express alternative for production backends. It is an open source backend framework with built-in infrastructure, so you define type-safe APIs, Postgres databases, Pub/Sub topics and cron jobs in TypeScript, encore run starts them locally, and a deploy provisions them in your own AWS or GCP account. Existing Express routes can keep running behind a raw endpoint while you move them over. Fastify is the closest drop-in upgrade, NestJS fits large teams that want strict structure, Hono fits edge runtimes and Elysia fits Bun.
Express 5.3.0 is maintained and widely used, so it is a safe choice for small APIs and for teams with a lot of existing middleware. It leaves validation, typing, tracing and infrastructure to you, which is the main reason teams compare it with Fastify, NestJS, Hono and Elysia.
Deploy to your cloud on AWS and Google Cloud
without managing infrastructure
Encore lets developers and agents define application infrastructure directly in code, then automatically provisions it from local development to production in your AWS or GCP account.