Tag: lambda

Should you minify Lambda code?

I thought minimizing Lambda function code was a best practice for Lambda optimization - it's even recommended by AWS in a not-so-old blog post. Turns out, I was wrong.
April 12, 2024
Read more

25 Good and Bad Serverless (and other) Announcements from re:Invent 2023

AWS re:Invent 2023 ended, so let's look at the most interesting announcements for serverless and more. There are exciting features to try and, maybe more importantly, features to avoid!
December 4, 2023
Read more

Dynamic Content with Lambda Response Streaming

With some creativity, we can use Lambda Response Streaming to dynamically show status updates, like the progress of long-running processes. And with proper TypeScript types and generator functions, we can write clean, dynamic content streaming Lambda with composable payload enrichers that will impress your work colleagues (if they are into this stuff).
November 22, 2023
Read more

Forcing Lambda Response Streaming to Flush Content

Lambda Response Streaming allows sending incremental responses, but those response chunks can arrive long after you write them. They are buffered in a rather unexpected way, delaying all messages you stream. But there is a workaround to force the stream to flush.
September 19, 2023
Read more

Building a CDK Construct Library: thoughts and tips

I recently created a CDK library provisioning a CI/CD pipeline for serverless apps on AWS. Having finished the "regular" JS library, it took me a day to convert it to a "proper" CDK Construct library. Not long, and I learned a lot. Here are my thoughts and tips.
June 14, 2023
Read more

AWS Lambda - Node.js vs. Python for serverless

After tabs vs. spaces, vi vs. emacs, let's fight over this: which is better, Node.js or Python for AWS Lambda and serverless in general? I have my opinion on this, and the fact I prefer TypeScript over Python makes me only slightly biased.
March 15, 2023
Read more

Top 12 Serverless Announcements from re:Invent 2022

re:Invent 2022, the annual AWS conference in Las Vegas, is now behind us. I did not attend in person, but that gave me time to consolidate this list of top new serverless features while everyone else is sleeping off the intense 5-day conference. And I envy them just a little.
December 6, 2022
Read more

AWS Lambda Performance Optimization

There are two reasons to optimize AWS Lambda functions performance. First is money – you pay for the Lambda execution duration. The quicker you do the job, the less you pay. The second is latency – the quicker you do the job, the shorter your client waits for the result. It's a known fact that the decrease of latency improves sales, user engagement, and client satisfaction – so we could argue it's also the money, in the end.
April 26, 2021
Read more

AWS JavaScript SDK v3 - usage, problems, testing

The new version of AWS SDK for JavaScript / TypeScript / Node.js came with a few significant improvements. But does "General Availability" mean "ready for the production"? How to use it? And how to unit test our code using it? Let's take a look at it.
March 22, 2021
Read more

AWS Lambda logging best practices

Logging in AWS Lambda functions is simple. You just print the message, and it's sent to the CloudWatch Logs. And everything is fine until you get a surprisingly big bill for the CloudWatch usage, or you need to actually debug some live system. Here are my tips for logging in AWS Lambda, based on my experience with real-live, big-scale functions running on production.
March 1, 2021
Read more