Menu

1 / 2

BunOnLambda Broke Our NodeJsApis But Saved Us 40% On Lambda Costs

DEV Community·Dinesh_gowtham·6 months ago
#zNxCMWAQ
#lambda#bunjs#node#serverless#bunonlambda
Reading 0:00
15s threshold

After migrating 15 Lambdas to BunOnLambda, we saw a whopping 40% reduction in Lambda costs but also encountered 7 broken Node.js APIs. Was it worth the switch? We'll dive into the lessons learned and the gotchas that surprised us.

Introduction to BunOnLambda

BunOnLambda is a new runtime for AWS Lambda that uses the Bun JavaScript runtime under the hood. It's 3x faster than Node.js 22 and offers a significant reduction in Lambda costs. Here's an example of how to create a BunOnLambda function:

import { serve } from ' bun ' ;

serve ({ port : 3000 , fetch : ( request ) => { return new Response ( ' Hello, World! ' ); } });

Enter fullscreen mode

Exit fullscreen mode

Don't even think about using BunOnLambda without understanding its quirks - we wish we'd known about the differences in error handling before deploying to production.

Migrating Node.js APIs to BunOnLambda

Migrating existing Node.js APIs to BunOnLambda can be a challenge.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.