"We run a contact form API written in Express on Heroku, but the monthly running cost of several thousand yen concerns us," "We want to shave API latency down to milliseconds on our landing page"—in client development for corporate sites and small SaaS apps, demand for overhauling lightweight API foundations is surging.
Becoming the de facto standard in this space is the combination of Hono and Cloudflare Workers. With zero cold starts, distribution from 300 cities worldwide, and virtually zero cost for up to 10 million requests per month, it delivers both cost efficiency and high performance. In this article, we outline design guidelines for custom development projects replacing Express-based APIs with Hono + Workers.

Why Hono + Workers: Three Quantitative Benefits
Here is a comparison with an Express + container architecture, organized by metrics easy to explain in custom development estimates:
| Metric | Express + Cloud Run / ECS | Hono + Cloudflare Workers |
|---|---|---|
| Cold starts | Hundreds of ms to several seconds | Virtually zero |
| Monthly fixed cost | Minimum 1,000–3,000 yen / instance | Free up to 100,000 req/month |
| Global distribution | Single region | Automatic distribution from 300+ cities |
| Deployment time | Several minutes (image build) | Several seconds |
| Runtime | Node.js | V8 isolates (Web Standard APIs) |
For workloads with under 10 million requests per month and under 30 seconds of CPU time—which encompasses most B2B APIs—it is not uncommon for running costs to drop to less than one-tenth.
Minimal Skeleton
Hono's function signatures can be understood in 30 minutes by anyone who has worked with Express.
import { Hono } from "hono";
import { cors } from "hono/cors";
import { logger } from "hono/logger";
type Env = { Bindings: { DB: D1Database; SECRET: string } };
const app = new Hono<Env>();
app.use("*", logger());
app.use("/api/*", cors({ origin: ["https://gleamhub.net"] }));
app.post("/api/contact", async (c) => {
const body = await c.req.json();
await c.env.DB.prepare(
"INSERT INTO contacts (email, message) VALUES (?, ?)"
).bind(body.email, body.message).run();
return c.json({ ok: true });
});
export default app;
With wrangler deploy, edge distribution begins in about five seconds.
Authentication: "Avoid Storing Sessions in Workers" Is the Golden Rule
Workers are fundamentally stateless. Trying to retain session IDs inside Workers will leave you stranded, so building with JWT + KV / D1 session stores is the standard pattern.
- JWT verification — Handled entirely with
hono/jwtmiddleware - Short-lived access tokens — 5 to 15 minutes; store refresh tokens in KV
- OAuth integration — Running Auth.js on Workers is a stable pattern
As discussed in GitHub Code Security Risk Assessment Guide, secret management should be thoroughly enforced by injecting secrets automatically from CI using wrangler secret put, never hardcoding them in source code.
Database Integration: Three Options
When interacting with databases from Workers, the choices can be categorized into three options:
| Option | Strengths | Weaknesses | Ideal use cases |
|---|---|---|---|
| Cloudflare D1(SQLite) | Same platform, minimal latency | Weaker schema evolution capabilities | Landing page inquiries, form submissions |
| PostgreSQL via Hyperdrive | Reuses existing RDS / Neon | Requires connection pool design | API extensions for existing SaaS |
| PlanetScale / Turso | Globally distributed | Cost | Multi-region SaaS |
If an existing PostgreSQL database is a prerequisite, pairing Hyperdrive with SaaS Multi-Tenant Architecture Implemented with PostgreSQL RLS is a proven architecture in custom development. Since Drizzle ORM officially supports the Workers runtime, combining it with Drizzle ORM Migration Guide is also a compelling option.
Observability: "Logs Alone Are Not Enough"
The first hurdle encountered when debugging Workers is the inability to easily follow logs. Ensure observability using the following three-part toolkit:
- Tail Workers — Real-time log forwarding to Datadog or Sentry
- Workers Analytics Engine — Aggregate high-frequency metrics using SQL-like queries
- OpenTelemetry SDK — Propagate trace IDs upstream and downstream to provide end-to-end visibility between edge and origin
In enterprise-scale deployments, connecting to the distributed tracing foundations introduced in our OpenTelemetry Migration Guide is an increasingly common pattern.
Cases Where You Shouldn't Build with Workers
Workers are not a silver bullet. Consider alternative architectures if your use case matches any of the following:
- Heavy workloads requiring 30+ seconds of CPU time (PDF generation, large-scale image processing)
- WebSocket servers requiring persistent connections (demands Durable Objects and careful design rather than standalone Workers)
- Libraries dependent on local filesystems or specialized binaries (headless Chromium, native extensions, etc.)
- Strict financial or healthcare workloads that include offline environments
A realistic solution is to use container execution platforms like Cloud Run or AWS App Runner alongside them. Please also refer to our AWS App Runner migration guide.
Conclusion — "Lightweight APIs on the edge, heavy processing in containers"
In 2026, client API infrastructure presupposes using the edge and containers appropriately for their strengths. Hono + Workers is already safe to call the primary candidate in areas requiring lightweight APIs, low costs, and global distribution.
At GleamHub, we provide hands-on support ranging from phased migrations from Express to designing auth and DB integration, as well as setting up observability. If you would like to discuss revamping your corporate website API or reducing SaaS latency, please reach out through our contact form.








