An Edge-First TypeScript API Stack: Hono + Drizzle
For a newer AI-agent platform I reached past the usual Express/Nest defaults for a lighter, edge-friendly stack. Here is what Hono and Drizzle buy you — and the trade-offs to go in with eyes open.
An Edge-First TypeScript API Stack: Hono + Drizzle
On this page
Most of my backend work is NestJS, and for large domain-heavy systems that is the right call. But for VelaCrew.ai — a newer AI-agent platform — I wanted something lean and edge-friendly, so I built the API on Hono with Drizzle ORM over PostgreSQL. It is a deliberately different shape from a Nest monolith, and worth knowing when it fits.
Hono: small, fast, runs everywhere
Hono is a tiny web framework with a familiar middleware model that runs on Node, Bun, and edge runtimes alike. There is very little between the request and your handler, and the routing is fully typed:
import { Hono } from 'hono';
const app = new Hono();
app.get('/agents/:id', async (c) => {
const agent = await db.query.agents.findFirst({
where: eq(agents.id, c.req.param('id')),
});
return agent ? c.json(agent) : c.notFound();
});Drizzle: SQL you can see, types you do not write
Drizzle is a thin, type-safe layer over SQL — not a heavy ORM that hides the query. You declare the schema in TypeScript, and queries are inferred end to end, with no codegen step and no runtime surprises:
export const agents = pgTable('agents', {
id: uuid('id').primaryKey().defaultRandom(),
name: text('name').notNull(),
ownerId: uuid('owner_id').notNull(),
});
// inferred row type, inferred query results — for freeBecause it stays close to SQL, the query you write is the query that runs — easy to reason about and to optimise, which matters when the workload is unpredictable agent traffic.
Where it shines vs NestJS
NestJS gives you structure: DI, modules, guards, a strong convention for big teams and big domains. Hono + Drizzle gives you minimal overhead and runtime portability — fast cold starts, a small dependency surface, and the freedom to run at the edge. For a focused, modern service that does not need the full framework apparatus, that is a feature, not a gap.
The trade-offs to accept
- You assemble more yourself. No batteries-included DI or module system — you wire structure by hand, which is fine until the domain gets large.
- A smaller ecosystem than the Express/Nest world; you occasionally write what a plugin would have given you.
- Discipline matters more. With less framework opinion, consistency is on you and your conventions.
I would not rebuild a large enterprise monolith on it — that is still NestJS territory. But for a nimble, edge-deployable service where speed and simplicity win, Hono and Drizzle are a genuinely great pairing, and a refreshing reminder that the heavyweight default is not the only option.
Comments
Loading comments…