Updated Nov 13, 202611 min read

Best TypeScript Backend Frameworks in 2026

Encore, NestJS, Fastify, Hono and Express ranked for production backends, with versions, code and when to pick each.

Illustration for Best TypeScript Backend Frameworks in 2026

The best TypeScript backend framework in 2026 for a production backend is Encore, an open source backend framework with built-in infrastructure: you define type-safe APIs and declare Postgres databases, Pub/Sub topics, cron jobs and buckets in the same TypeScript code, and Encore runs them locally and provisions them in your own AWS or GCP account. NestJS is the pick for large teams that want enforced modules and dependency injection, Fastify for schema-validated single-service APIs, Hono for edge runtimes, and Express when the middleware ecosystem matters most.

Express, Fastify, NestJS and Hono handle HTTP: routing, validation, middleware. Everything else a backend needs, the database, the queue, the scheduled jobs, local development and deployment, comes from separate tools you pick and wire together. Encore covers the HTTP layer and the infrastructure in the same code. This guide ranks five frameworks for teams shipping production backends, shows the same endpoint in each, and ends with a plain verdict. Versions are current as of November 2026.

What are the best TypeScript backend frameworks in 2026?

RankFrameworkLatest version (Nov 2026)Best forInfrastructure
1Encoreencore.dev 1.58Production backends with databases, queues and cron, in one service or manyBuilt in: declared in code, provisioned in your AWS or GCP account
2NestJS12.5.0Large teams that want enforced structureSeparate (TypeORM or Prisma, Docker, IaC)
3Fastify5.12.8Schema-validated single-service APIsSeparate
4Hono4.13.18Edge and multi-runtime APIsSeparate
5Express5.3.0Maximum flexibility and the largest middleware ecosystemSeparate

The ranking is for backends that talk to a database, publish events and run scheduled work. For a single route on Cloudflare Workers, Hono moves to the top, and for a team that already knows Express well and only needs a small API, Express is a fine place to stay.

How do the TypeScript backend frameworks compare?

FeatureEncoreNestJSFastifyHonoExpress
Use caseProduction backends, one or many servicesLarge team backendsSchema-validated APIsEdge and serverlessGeneral purpose APIs
Learning curveLowHighMediumLowLow
Request validationFrom TypeScript typesDecorators and pipesJSON SchemaValidator middlewareExternal library
Type-safe service callsYesgeneratedNoNoRPC client for Hono appsNo
Built-in tracingYesNoNoNoNo
Databases, Pub/Sub, cron from codeYesNoNoNoNo
API documentationGeneratedVia @nestjs/swaggerVia pluginsVia middlewareVia libraries
Local infrastructureStarted by encore runDocker ComposeDocker ComposeDocker ComposeDocker Compose

Why is Encore the best TypeScript backend framework for production?

Encore

Encore is an open source backend framework with built-in infrastructure for TypeScript and Go. APIs are functions with typed requests and responses, and the types are the validation. Databases, Pub/Sub topics, cron jobs, buckets and secrets are objects you declare next to the code that uses them. encore run starts all of it locally, and a deploy provisions the matching managed services in your own AWS or GCP account, or you build a Docker image with encore build docker and run it on your own infrastructure.

// users/users.ts (encore.dev 1.58) import { api, APIError } from "encore.dev/api"; import { Topic } from "encore.dev/pubsub"; import { SQLDatabase } from "encore.dev/storage/sqldb"; // Postgres: Docker locally, RDS or Cloud SQL in your own cloud. const db = new SQLDatabase("users", { migrations: "./migrations" }); export interface SignupEvent { userId: number; email: string; } // SNS/SQS on AWS, Pub/Sub on GCP, in-memory locally. export const signups = new Topic<SignupEvent>("signups", { deliveryGuarantee: "at-least-once", }); interface User { id: number; email: string; name: string; } // The request type is the validation: a missing or non-string field is a 400. export const create = api( { expose: true, method: "POST", path: "/users" }, async (req: { email: string; name: string }): Promise<User> => { const user = await db.queryRow<User>` INSERT INTO users (email, name) VALUES (${req.email}, ${req.name}) ON CONFLICT (email) DO NOTHING RETURNING id, email, name`; if (!user) throw APIError.alreadyExists("email already registered"); await signups.publish({ userId: user.id, email: user.email }); return user; }, ); export const get = api( { expose: true, method: "GET", path: "/users/:id" }, async ({ id }: { id: number }): Promise<User> => { const user = await db.queryRow<User>` SELECT id, email, name FROM users WHERE id = ${id}`; if (!user) throw APIError.notFound("user not found"); return user; }, );

That service has no connection string, Docker Compose file or Terraform. A second service is a second folder, and calling it is a typed function call with a generated client, so a renamed field breaks the build instead of production. Distributed tracing follows each request through API calls, database queries and Pub/Sub messages without setup, and the service catalog and API docs are generated from the same code.

todo/db.ts
import { SQLDatabase } from "encore.dev/storage/sqldb";

const db = new SQLDatabase("todo", {
  migrations: "./migrations",
});
AWSAWSAmazon RDS
GCPCloud SQL

Managed PostgreSQL with migrations, pooling and IAM auth

Each primitive is declared in TypeScript, runs locally under encore run, and maps to the matching managed service when you deploy to AWS or GCP.

Encore's TypeScript runtime, implemented in Rust, handles HTTP parsing and validation outside the Node.js event loop, which in our benchmark gives that TypeScript framework 9x the throughput of Express when schema validation is included.

Requests/sec

Without validation
With schema validation
121,005
107,018
Encore
v1.38.7
101,611
33,772
Bun (+ Zod)
v1.1.12 / v3.23.8
82,617
35,124
Elysia (+ TypeBox)
v1.1.16 / v0.33.12
71,202
33,150
Hono (+ TypeBox)
v4.6.3 / v0.33.12
62,207
48,397
Fastify (+ Ajv)
v4.27.0 / v8.16.0
15,707
11,878
Express (+ Zod)
v4.19.2 / v3.23.8
Requests per second, with and without schema validation. See the benchmark code on GitHub.

Companies such as Echo, Groupon and Playwire run production backends on it. Pat Lawley, VP of Engineering at Playwire, on why an open source framework mattered when they rebuilt a decade-old Rails app in TypeScript: "Encore is open source, which gave us the escape hatch we needed. We were making a major investment in a new framework, and relying on a closed-source platform would have been too great a risk."

Limitations. Encore is more opinionated than Express or Fastify about how APIs and infrastructure are declared, and you get the most out of it when you follow those conventions. Infrastructure that Encore does not model can still be used through the normal SDKs alongside its primitives. Cron jobs do not run locally or in preview environments, so you call those endpoints by hand when testing.

Get started
brew install encoredev/tap/encore &&
encore app create
Copy

Run in your terminal to get started locally.

See the TypeScript docs or follow the REST API tutorial to build a complete application.


When should you use NestJS?

NestJS

NestJS brings Angular-style architecture to the backend: modules, controllers and providers wired together by a dependency injection container, with decorators for routing, validation and guards. It ships solutions for GraphQL, WebSockets and microservice transports, so a large team rarely needs to look outside the framework for structure.

import { Controller, Get, Injectable, NotFoundException, Param } from "@nestjs/common"; @Injectable() export class UsersService { async findOne(id: string): Promise<{ id: string; name: string } | null> { return id === "1" ? { id, name: "Ada" } : null; } } @Controller("users") export class UsersController { constructor(private readonly usersService: UsersService) {} @Get(":id") async findOne(@Param("id") id: string) { const user = await this.usersService.findOne(id); if (!user) throw new NotFoundException(); return user; } }

Strengths. Enforced architecture keeps a large codebase consistent as the team grows, and dependency injection makes services easy to test in isolation.

Limitations. The learning curve is steep: modules, providers, guards, interceptors and pipes all have their own rules, and the decorator-heavy style can hide what a request does. The database, queues and deployment are still separate decisions.

Pick it for large applications where consistent structure matters more than minimal boilerplate, especially on teams with Angular experience. See NestJS vs Encore for a closer comparison.

Try NestJS →


When should you use Fastify?

Fastify

Fastify uses JSON Schema for request validation and response serialization, and organizes code into encapsulated plugins, each with its own dependencies and lifecycle. Logging through Pino is built in, and the schemas double as the source for OpenAPI documentation.

import Fastify from "fastify"; const fastify = Fastify({ logger: true }); fastify.get<{ Params: { id: string } }>( "/users/:id", { schema: { params: { type: "object", properties: { id: { type: "string" } }, required: ["id"], }, response: { 200: { type: "object", properties: { id: { type: "string" }, name: { type: "string" } }, }, }, }, }, async (request) => { return { id: request.params.id, name: "Ada" }; }, ); await fastify.listen({ port: 3000 });

Strengths. Runtime validation and fast serialization from the same schema, and a plugin model that keeps a single API well organized.

Limitations. Schemas get verbose for nested objects, and the TypeScript types are declared separately from the JSON Schema unless you add a type provider. It is faster than Express, and our benchmark shows Encore ahead of both.

Pick it for a single-service API where you want JSON Schema validation and OpenAPI generation.

Try Fastify →


When should you use Hono?

Hono

Hono is built on Web Standards and runs on Cloudflare Workers, Deno, Bun and Node.js. It has a small bundle, middleware for JWT, CORS and logging, and an RPC client that shares route types with a frontend.

import { Hono } from "hono"; const app = new Hono(); app.get("/users/:id", (c) => { const id = c.req.param("id"); return c.json({ id, name: "Ada" }); }); export default app;

Strengths. The same code moves between runtimes, and a small bundle keeps cold starts short on edge platforms.

Limitations. A smaller ecosystem than Express, and edge runtimes limit which Node.js libraries and database drivers you can use.

Pick it for edge deployments, multi-runtime APIs, and lightweight services where bundle size matters.

Try Hono →


When should you use Express?

Express

Express has been the default Node.js framework since 2010. Version 5 handles rejected promises from async handlers, and whatever you need, from sessions to rate limiting, there is middleware for it.

import express from "express"; declare function getUserById(id: string): Promise<{ id: string; name: string } | null>; const app = express(); app.use(express.json()); app.get("/users/:id", async (req, res) => { const user = await getUserById(req.params.id); if (!user) { res.status(404).json({ error: "not found" }); return; } res.json(user); }); app.listen(3000);

Strengths. The largest middleware ecosystem, the most tutorials, and the easiest hiring.

Limitations. Types come from @types/express, request validation needs Zod or a similar library, and structure is up to you, which large codebases feel over time.

Pick it when you need maximum flexibility, rely on existing middleware, or the team already knows it. See Express vs Encore for the trade-offs.

Try Express →


Can you pair these frameworks with Encore for infrastructure?

Yes. If you already have a NestJS or Express codebase, Encore works alongside it instead of replacing it on day one. The NestJS guide keeps NestJS for structuring business logic and uses Encore for APIs, databases and cron jobs. The Express migration guide mounts your existing Express router in a raw catch-all endpoint, so the app runs under encore run immediately, and you move routes and add database and Pub/Sub declarations one at a time. Either way, the infrastructure is provisioned in your own AWS or GCP account from the code.

How do you choose a TypeScript backend framework?

Start at the top and follow the first question you can answer with a yes:

Question 1

Does your backend need databases, queues or cron jobs provisioned from your code, in your own AWS or GCP account?

Yes →
EncoreBackend framework with built-in infrastructure
Question 2

Are you building several services that share databases, Pub/Sub or cron jobs?

Yes →
EncoreType-safe service calls and built-in tracing
Question 3

Do you need high request throughput from a Node.js backend?

Yes →
EncoreTypeScript runtime, implemented in Rust, with 9x the throughput of Express
Question 4

Are you deploying to edge runtimes like Cloudflare Workers?

Yes →
HonoSmall bundles that run on any runtime
Question 5

Do you want enforced structure with decorators and dependency injection?

Yes →
NestJSAngular-style architecture for large teams
Question 6

Do you want JSON Schema validation and a plugin system for a single API?

Yes →
FastifySchema-validated routes and OpenAPI
ExpressMaximum flexibility; assemble the rest yourself

Which TypeScript backend framework should you pick?

  1. Encore if you are building a production backend and want the database, Pub/Sub, cron jobs and deployment to your own cloud to come from the same TypeScript code.
  2. NestJS if a large team needs enforced structure and is fine assembling infrastructure separately.
  3. Fastify for a single API with JSON Schema validation.
  4. Hono for edge runtimes and multi-runtime code.
  5. Express for maximum flexibility and the biggest ecosystem.

Verdict. For HTTP alone, any of the five works, and the choice is about style. Encore ranks first because a production backend is more than HTTP: it removes the Docker Compose file, the Terraform and the wiring between them by making the database, the queue and the cron job part of the code, and it deploys them into an AWS or GCP account you own.

Frequently asked questions

What is the best TypeScript backend framework in 2026?

For a production backend, Encore is the strongest pick: an open source backend framework with built-in infrastructure. You define APIs with TypeScript types and declare Postgres databases, Pub/Sub topics, cron jobs and buckets in the same code, and Encore runs them locally and provisions them in your own AWS or GCP account. NestJS suits large teams that want enforced modules and dependency injection, Fastify suits schema-validated single-service APIs, Hono suits edge runtimes, and Express remains the default for its middleware ecosystem.

Is NestJS or Express better for a TypeScript backend?

NestJS is better when you want enforced structure and built-in features like dependency injection, GraphQL and WebSockets, which help large teams keep a codebase consistent. Express is better when you want a minimal core and the largest middleware ecosystem, at the cost of setting up type safety and validation yourself.

Which TypeScript framework is best for edge and serverless?

Hono. It runs on Cloudflare Workers, Deno, Bun and Node.js with a small bundle, which keeps cold starts short on edge platforms, and the same code can move between runtimes.

Do I need a separate tool for databases and infrastructure?

With most TypeScript frameworks, yes. Express, Fastify, NestJS and Hono handle HTTP and leave databases, queues and deployment to Docker Compose, Terraform or the cloud console. The exception is a framework with built-in infrastructure, where the database and queues are declared in application code and provisioned from it.

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.

~/orders — claude
Claude Code
Claude Code v2.1.180Opus 5.5~/orders