Encore.ts vs Hono vs Elysia: Type-Safe Backend Starters for SaaS 2026
TL;DR
Hono is the pragmatic choice — it runs everywhere (Workers, Bun, Deno, Node), has the largest ecosystem, and plenty of SaaS starters. Elysia is the fastest option on Bun with an excellent ergonomics story. Encore.ts is the most opinionated — it generates infrastructure as code from TypeScript decorators and manages your cloud deployment. Pick Hono for flexibility, Elysia for Bun performance, Encore for managed infrastructure without Terraform.
Key Takeaways
- Hono runs on 5+ runtimes (Workers, Bun, Deno, Node, Lambda) — widest deployment flexibility
- Elysia is Bun-first, uses Eden Treaty for end-to-end type safety rivaling tRPC
- Encore.ts generates AWS/GCP infrastructure from TypeScript annotations — no Terraform needed
- All three are faster than Express in benchmarks; Elysia + Bun is the fastest overall
- Starter ecosystems: Hono > Elysia > Encore for SaaS-specific templates
- Best pairing: Hono + D1 (edge), Elysia + Bun (performance), Encore (full-stack managed infra)
The Three Frameworks
| Hono | Elysia | Encore.ts | |
|---|---|---|---|
| Runtime | Any JS runtime | Bun-first | Node.js (cloud backend) |
| Philosophy | Micro, composable | Ergonomic, fast | Infrastructure-as-code |
| E2E Types | Via OpenAPI/RPC | Eden Treaty | Encore client gen |
| Stars | 20k+ | 11k+ | 8k+ |
| SaaS starters | 20+ | 5-10 | 2-3 |
| Best for | Edge/multi-runtime | Bun API servers | Cloud-native apps |
| Deployment | Worker/VPS/Lambda | Bun servers | Encore Cloud or AWS/GCP |
Hono — The Multi-Runtime Champion
Founded: 2022 | Creator: Yusuke Wada | Stars: 20k+
Hono started as a Cloudflare Workers framework and evolved into the web framework that runs anywhere. The API surface is Express-like but modernized with TypeScript-first design, built-in middleware, and a tiny bundle size.
Why SaaS Teams Choose Hono
import { Hono } from "hono";
import { zValidator } from "@hono/zod-validator";
import { z } from "zod";
const app = new Hono();
// Type-safe request validation
const createProjectSchema = z.object({
name: z.string().min(1).max(100),
slug: z.string().regex(/^[a-z0-9-]+$/),
});
app.post(
"/projects",
zValidator("json", createProjectSchema),
async (c) => {
const { name, slug } = c.req.valid("json"); // typed!
const project = await db.insert(projects).values({ name, slug, userId: c.var.userId });
return c.json(project, 201);
}
);
// RPC — call from client with full types
// Using hono/client
import type { AppType } from "./server";
import { hc } from "hono/client";
const client = hc<AppType>("http://localhost:3000");
const res = await client.projects.$post({ json: { name: "My SaaS", slug: "my-saas" } });
Hono SaaS Starters
# Cloudflare Workers (most popular)
npm create cloudflare@latest my-api -- --type=hono
# Bun
bun create hono my-api --template bun
# Node.js
npm create hono my-api -- --template nodejs
# Vercel
npm create hono my-api -- --template vercel
Community SaaS starters:
- hono-saas-starter — Workers + D1 + Clerk + Stripe
- hono-drizzle-starter — Bun + Hono + Drizzle + Postgres
- Multiple "hono + shadcn" full-stack starters on GitHub
Hono Strengths
- ✅ Deploy anywhere — migrate from Workers to Bun to Lambda without rewriting
- ✅ Large middleware ecosystem (
@hono/zod-validator,@hono/clerk-auth,@hono/cors) - ✅ Most SaaS starters of the three
- ✅ Excellent documentation
Hono Weaknesses
- ❌ No built-in database abstraction
- ❌ Type inference requires RPC client setup (not automatic like Elysia's Eden)
- ❌ File-based routing requires a plugin
Elysia — Bun-Native Performance
Founded: 2023 | Creator: SaltyAom | Stars: 11k+
Elysia was built specifically for Bun. It's the fastest JavaScript API framework in benchmarks (beating Fastify, Hono, Express on throughput). The DX is excellent: Eden Treaty gives you tRPC-level type safety without a separate package.
Elysia's Eden Treaty
// server.ts
import { Elysia, t } from "elysia";
const app = new Elysia()
.get("/", "Hello Elysia")
.post(
"/projects",
({ body }) => {
// body is typed from the schema!
return db.insert(projects).values(body);
},
{
body: t.Object({
name: t.String({ minLength: 1 }),
slug: t.String({ pattern: "^[a-z0-9-]+$" }),
}),
}
)
.listen(3000);
export type App = typeof app;
// client.ts — zero config, full types
import { treaty } from "@elysiajs/eden";
import type { App } from "./server";
const client = treaty<App>("http://localhost:3000");
// Fully typed — no separate schema file or type generation step
const { data, error } = await client.projects.post({
name: "My SaaS",
slug: "my-saas",
});
Eden Treaty is the standout feature. Unlike tRPC (which requires a separate router/procedure definition) or Hono RPC (which requires hc() client), Eden Types flow automatically from your Elysia app definition.
Elysia with Bun's Built-In Features
import { Elysia } from "elysia";
import { Database } from "bun:sqlite"; // Bun built-in SQLite
const db = new Database("myapp.db");
db.run(`CREATE TABLE IF NOT EXISTS users (
id TEXT PRIMARY KEY,
email TEXT UNIQUE,
created_at INTEGER
)`);
const app = new Elysia()
.get("/users/:id", ({ params }) => {
return db.query("SELECT * FROM users WHERE id = ?").get(params.id);
})
.listen(3000);
Elysia SaaS Starters
The ecosystem is growing but smaller than Hono:
# Official starter
bun create elysia my-app
# Community starters
bunx degit saltyaom/elysia-bun-example my-app
bunx degit elysiajs/elysia-with-prisma my-app
Notable: elysia-saas-starter (community) — Bun + Elysia + Drizzle + Clerk + Stripe.
Elysia Strengths
- ✅ Fastest TypeScript API framework (Bun runtime)
- ✅ Eden Treaty: best E2E type safety DX
- ✅ Plugin system with lifecycle hooks
- ✅ Swagger/OpenAPI generation built-in
Elysia Weaknesses
- ❌ Bun-dependent — some Node.js compatibility gaps
- ❌ Smaller ecosystem and fewer SaaS starters
- ❌ Less mature than Hono for production workloads
Encore.ts — Infrastructure as TypeScript
Founded: 2021 | Creator: Encore team | Stars: 8k+
Encore.ts takes a fundamentally different approach. Instead of being a web framework, it's a backend development platform where you annotate TypeScript with Encore decorators, and Encore generates your cloud infrastructure (AWS/GCP/Azure or Encore Cloud) automatically.
// No express, no hono, no routing — just Encore annotations
import { api, APIError } from "encore.dev/api";
import { SQLDatabase } from "encore.dev/storage/sqldb";
// Encore generates a PostgreSQL database
const db = new SQLDatabase("saas", {
migrations: "./migrations",
});
// This becomes an HTTP endpoint
export const getProject = api(
{ expose: true, method: "GET", path: "/projects/:id" },
async ({ id }: { id: string }) => {
const project = await db.queryRow`
SELECT * FROM projects WHERE id = ${id}
`;
if (!project) throw APIError.notFound("Project not found");
return { project };
}
);
// This becomes a Pub/Sub publisher
import { Topic } from "encore.dev/pubsub";
export const ProjectCreated = new Topic<{ projectId: string; userId: string }>(
"project-created",
{ deliveryGuarantee: "at-least-once" }
);
// This becomes a subscriber
import { Subscription } from "encore.dev/pubsub";
export const sendWelcomeEmail = new Subscription(ProjectCreated, "send-welcome-email", {
handler: async (event) => {
await resend.emails.send({
to: await getUserEmail(event.userId),
subject: "Welcome to the project",
html: `<p>Your project ${event.projectId} is ready.</p>`,
});
},
});
Encore's magic: This TypeScript code gets parsed by Encore's compiler, which generates:
- AWS Lambda functions + API Gateway
- RDS PostgreSQL database
- SNS/SQS for Pub/Sub
- IAM roles and security groups
- CloudFormation or Terraform (you never see it)
Encore SaaS Starters
# Official Encore CLI
encore app create my-saas --example=user-auth
# Available examples
encore app create --example=slack-bot
encore app create --example=saas-starter
encore app create --example=stripe-checkout
Encore maintains ~10 official example applications and a growing community library.
Encore Strengths
- ✅ No infrastructure code to write or maintain
- ✅ Distributed tracing, metrics, and logging built-in
- ✅ Local development with production parity (runs services locally)
- ✅ Encore Cloud manages deployments ($0 for development)
- ✅ Type-safe microservices with generated client
Encore Weaknesses
- ❌ Lock-in to Encore's deployment model (even if targeting AWS)
- ❌ Doesn't work with Bun or Cloudflare Workers
- ❌ Smaller community than Hono/Elysia
- ❌ Less flexibility for custom infrastructure
Comparison: Same SaaS Feature in Three Frameworks
Let's implement a simple "create organization" endpoint:
Hono
app.post(
"/organizations",
zValidator("json", createOrgSchema),
clerkMiddleware(),
async (c) => {
const { userId } = getAuth(c);
const { name, slug } = c.req.valid("json");
const org = await db.insert(organizations).values({ id: nanoid(), name, slug, ownerId: userId }).returning();
return c.json(org[0], 201);
}
);
Elysia
app.post(
"/organizations",
async ({ body, store: { userId } }) => {
return db.insert(organizations).values({ id: nanoid(), ...body, ownerId: userId }).returning();
},
{
body: t.Object({
name: t.String({ minLength: 1 }),
slug: t.String({ pattern: "^[a-z0-9-]+$" }),
}),
beforeHandle: [authenticate],
}
);
Encore.ts
export const createOrganization = api(
{ expose: true, method: "POST", path: "/organizations", auth: true },
async ({ name, slug }: { name: string; slug: string }) => {
const userId = getAuthData()!.userID;
const org = await db.queryRow`
INSERT INTO organizations (id, name, slug, owner_id)
VALUES (gen_random_uuid(), ${name}, ${slug}, ${userId})
RETURNING *
`;
return { organization: org };
}
);
Choosing Your Framework
| You should choose | If |
|---|---|
| Hono | Deploying to Cloudflare Workers / edge; need multi-runtime flexibility; want the most starters |
| Elysia | Using Bun; want best performance; love Eden Treaty's DX; building a pure API backend |
| Encore.ts | Want to eliminate infrastructure management; building microservices; hate Terraform |
For a typical Next.js SaaS (API routes)
Stick with Next.js Route Handlers — none of these frameworks add value for a monolithic Next.js app with a few API routes.
For a dedicated API service
Hono if you want edge deployment, Elysia if you're on Bun, Encore if you want managed infrastructure.
Methodology
- Reviewed Hono (v4), Elysia (v1.2), and Encore.ts (v1.x) documentation as of March 2026
- Benchmarked request throughput from published benchmark repositories (TechEmpower, bun/elysia benchmarks)
- Analyzed community starter ecosystems on GitHub
- Tested Eden Treaty type safety with a sample Elysia + Next.js project
- Reviewed Encore.ts infrastructure generation via their local development runner
Find all Hono, Elysia, and Encore starters on StarterPick — filter by framework, runtime, and features.
Check out this boilerplate
View Hono + Cloudflare on StarterPick →