← Semua picks

Stack Comparison Recommended

Hono vs Elysia vs Express di Bun runtime

3 web framework untuk Bun. Hono = portable + battle-tested. Elysia = Bun-native + TypeScript-first. Express = legacy compat. Saya pakai ketiganya, verdict berbeda.

14 Mei 2026 · 8 menit ·Use case: API server untuk SaaS Indonesia
HonoElysiaExpressBun

TL;DR

  • Hono: Recommended untuk most SaaS API. Portable (Bun + Node + Deno + Cloudflare Workers), mature, RPC client built-in.
  • Elysia: Recommended kalau Anda sure tidak akan pindah runtime. Bun-native, performance terbaik, TypeScript-first.
  • Express: Skip untuk project baru. Legacy compatibility only.

Konteks

API server untuk 3 klien Indonesia, 2024-2026:

  • SaaS klinik dental BSD: Hono di Bun, deploy Cloudflare Workers
  • SaaS billing fotograf: Elysia di Bun, deploy Hetzner VPS
  • Internal tool kontraktor: Express di Node, deploy Hetzner VPS (legacy, sudah ada team Express)

Hono

Apa itu: Web framework yang focus on portability + edge runtimes.

Pro:

  • Run di Bun, Node, Deno, Cloudflare Workers, Vercel Edge, AWS Lambda — same code.
  • Middleware ecosystem matang (auth, CORS, logger, cache, RPC client)
  • Hono RPC: type-safe client-server (mirip tRPC tapi via Hono routing)
  • Active development, ~3 release per bulan
  • Documentation excellent

Con:

  • Performance bagus tapi tidak yang terbaik di Bun (Elysia ~10-15% lebih cepat untuk hot path)
  • Some Bun-specific features tidak diekspos (e.g., Bun.serve options)

Bila pakai: API server yang mungkin perlu pindah runtime di masa depan. Atau project yang Anda mau deploy ke edge (Cloudflare Workers).

Elysia

Apa itu: Web framework yang Bun-native, TypeScript-first.

Pro:

  • Performance terbaik di Bun runtime (TechEmpower benchmark mengukuhkan ini)
  • TypeScript inference yang sangat baik (compile-time type checking untuk route + middleware)
  • Schema validation built-in (replace Zod kalau Anda mau)
  • Elysia plugin ecosystem cocok untuk Bun-specific use case (file upload, WebSocket, SSE)

Con:

  • Bun-only: tidak run di Node, Deno, Cloudflare Workers. Vendor lock-in (ke Bun).
  • Ecosystem lebih kecil dari Hono (~30% library coverage)
  • Documentation OK tapi tidak se-comprehensive Hono
  • Breaking changes lebih sering (Elysia masih < 1.0 stability promise)

Bila pakai: SaaS API yang Anda commit ke Bun, dan butuh max performance. Atau Anda super-suka TypeScript inference dan willing to lock-in.

Express

Apa itu: Veteran web framework JavaScript sejak 2010.

Pro:

  • Most mature ecosystem (literally everything has Express middleware)
  • Familiar untuk dev Node senior
  • Battle-tested at scale (Netflix, Uber, banyak company pakai di production)

Con:

  • Tidak TypeScript-first: setiap middleware butuh typing manual atau community types
  • Performance lagging: di Bun, Express 30-40% lebih lambat dari Hono atau Elysia
  • API design dated: callback + middleware pattern, tidak modern async/await idiomatic
  • Stagnant: Express 5 baru release 2024 after 10+ tahun. Express 4 banyak deprecation.

Bila pakai: only kalau legacy team / project. Untuk project baru: tidak ada alasan pilih Express di 2026.

Benchmark

Setup: simple JSON API dengan 1 middleware (CORS) + 1 route (/api/users/:id return JSON).

Hardware: Hetzner CX21 (2 vCPU, 4GB RAM, Singapore).

FrameworkRuntimeReq/secp50 latencyp99 latency
HonoBun 1.3142,0000.4ms2.1ms
ElysiaBun 1.3168,0000.3ms1.8ms
ExpressBun 1.389,0000.8ms4.2ms
ExpressNode 2276,0001.0ms5.1ms
HonoNode 22118,0000.5ms2.8ms
HonoCloudflare Workers95,0001.2ms4.5ms

Elysia menang single-runtime (Bun). Hono compete with same numbers di Bun + Node + CF Workers.

Express signifikan tertinggal di kedua runtime.

DX comparison

Hono — example

import { Hono } from 'hono';
import { logger } from 'hono/logger';
import { cors } from 'hono/cors';

const app = new Hono();
app.use(logger(), cors());

app.get('/users/:id', async (c) => {
  const id = c.req.param('id');
  const user = await db.users.findById(id);
  return c.json(user);
});

export default app;

Elysia — example

import { Elysia, t } from 'elysia';

const app = new Elysia()
  .use(cors())
  .get('/users/:id', async ({ params: { id } }) => {
    return await db.users.findById(id);
  }, {
    params: t.Object({ id: t.String() })
  });

export default app;

Express — example (untuk reference)

import express from 'express';
import cors from 'cors';

const app = express();
app.use(cors());

app.get('/users/:id', async (req, res) => {
  const user = await db.users.findById(req.params.id);
  res.json(user);
});

export default app;

Elysia paling concise dengan type inference build-in. Hono lebih portable. Express paling familiar.

Migration cost

Hono ↔ Elysia: 2-4 jam untuk simple API. Both pakai modern async patterns.

Hono → Express atau Elysia → Express: 4-8 jam (Anda kehilangan type safety, perlu add manual typing).

Express → Hono: 6-12 jam untuk medium API (~30 routes). Worth kalau Anda planning pindah ke Bun atau edge.

Verdict per shape API

ShapeRecommended
SaaS API + butuh portabilityHono
Bun-only, max performanceElysia
Edge-first (Cloudflare Workers)Hono
Legacy migrationExpress (stay) OR Hono (migrate)
Project baru, no constraintHono (safer) atau Elysia (bolder)

Yang surprising

Klien fotograf saya pilih Elysia awalnya karena performance benchmark. Setelah 8 bulan production, kami discover bahwa performance bottleneck bukan di web framework — bottleneck di database query + image processing. Web framework menyumbang < 5% dari total request latency.

Pelajaran: pilih web framework based on DX + portability, bukan benchmark mikro. Performance differences (10-20%) di framework level rarely matter untuk SMB Indonesia API.

Verdict

Recommended: Hono untuk default new project. Bun atau Node atau CF Workers — sama-sama work.

  • Pilih Elysia kalau Anda yakin di Bun forever dan butuh squeeze max performance + TS inference.
  • Skip Express untuk new project. Hanya stay kalau migration cost lebih tinggi dari benefit.

Ditulis oleh Asti Larasati

// Pick Stack Comparison lain


← Semua picks RSS feed