77. How do you use Lambda Response Streaming?
Are you tired of waiting for your Lambda functions to finish before getting a response? Well, now you don't have to! In this episode of the AWS Bites podcast, we will talk about Lambda Response Streaming, a new feature recently added by AWS that lets you stream responses from your Lambda functions in real time.
We'll start by explaining what Lambda Response Streaming is and how it differs from buffering. We'll also discuss HTTP Chunking and other benefits of streaming. If you're a Node.js developer, you'll be happy to know that we'll cover how to work with streams in Node.js and how the new Lambda Response Streaming API works with the Node.js runtime.
But that's not all! We'll also discuss how to consume Lambda Response Streaming responses and compare that with S3 Object Response. And if you're wondering about pricing and quotas, we'll cover that too.
Finally, we'll answer the question on everyone's mind: will we get streaming requests as well? You'll have to watch the video to find out!
So if you're interested in learning more about Lambda Response Streaming and how it can improve the performance of your serverless applications, make sure to tune in. We promise it'll be worth your time.
? SPONSORS ?
AWS Bites is sponsored by fourTheorem (
https://fourtheorem.com). fourTheorem is an AWS Consulting Partner offering training, cloud migration, and modern application architecture.
? Chapters:
00:00 Intro
01:05 What is Lambda Resonse Streaming?
03:00 What is streaming and how is it different from buffering?
06:20 HTTP Chunking
07:09 Other benefits of streaming and some advantages of buffering
09:09 Understanding streams in Node.js
12:20 How the new Lambda Response Streaming API works with the Node.js runtime
15:09 How do you consume responses from Lambda Response Streaming
17:51 Quotas and pricing of Lambda Response Streaming
19:28 How does S3 Object Response compare with Lambda Response Streaming
21:31 Will we get streaming requests as well?
26:04 Closing
In this episode, we mentioned the following resources:
- Official announcement blog post for Lambda Response Streaming:
https://aws.amazon.com/blogs/compute/introducing-aws-lambda-response-streaming/- Our previous episode about Lambda function URLs vs API GW vs LB:
https://awsbites.com/74-function-urls-vs-api-gateway/ - HTTP Chunked encoding
https://en.wikipedia.org/wiki/Chunked_transfer_encoding- Luciano's free Node.js streams workshop on GitHub:
https://github.com/lmammino/streams-workshop- Node.js design patterns (book):
https://nodejsdesignpatterns.com - Streamify response functionality in Middy:
https://middy.js.org/docs/intro/streamify-response/- Lambda Rust Runtime codebase (support for Response Streaming):
https://github.com/awslabs/aws-lambda-rust-runtime/blob/3fce312eb77f7ec1722e1c4605b11f770e286ed9/lambda-runtime/src/streaming.rs#L214- Similar evidence in the GoLang Runtime:
https://github.com/aws/aws-lambda-go/blob/81d63bd21219911099b1dd9a2b1e4d46d4a87288/events/lambda_function_urls.go#L134- Our previous episode about S3 pre-signed URLs:
https://awsbites.com/56-what-can-you-do-with-s3-presigned-urls/- Lambda Response Streaming pricing:
https://aws.amazon.com/lambda/pricing/#:~:text=Lambda HTTP Response Stream Pricing,-AWS Lambda functions
- Eoin's article about S3 Object Response:
https://eoins.medium.com/using-s3-object-lambdas-to-generate-and-transform-on-the-fly-874b0f27fb84- Experimental Node.js custom Node.js streaming runtime:
https://github.com/lmammino/lambda-node-streaming-runtime/You can listen to AWS Bites wherever you get your podcasts:
- Apple Podcasts:
https://podcasts.apple.com/us/podcast/aws-bites/id1585489017- Spotify:
https://open.spotify.com/show/3Lh7PzqBFV6yt5WsTAmO5q - Google:
https://podcasts.google.com/feed/aHR0cHM6Ly9hbmNob3IuZm0vcy82YTMzMTJhMC9wb2RjYXN0L3Jzcw== - Breaker:
https://www.breaker.audio/aws-bites- RSS:
https://anchor.fm/s/6a3312a0/podcast/rss Do you have any AWS questions you would like us to address?
Leave a comment here or connect with us on Twitter:
-
https://twitter.com/eoins-
https://twitter.com/loige#AWS #lambda #stream
...
https://www.youtube.com/watch?v=0mVL2pgzJ4o