Why one Lambda function with Hono can beat one function per route
A developer explains why they now start most HTTP APIs on AWS Lambda as a single function that handles its own routing, using the Hono framework. Hono is a lightweight TypeScript framework built on standard Request and Response objects, so the same app can run on several runtimes, including Lambda via an adapter. The approach simplifies deployment, middleware, testing and cold-start behaviour, though all routes then share one IAM role, memory setting and timeout. The author suggests splitting out individual routes only when their requirements clearly differ. The article also notes that Hono's Lambda adapter has moved to the @hono/aws-lambda package, with the older import path deprecated and slated for removal in Hono 5.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in