AWS Deep Dive — AWS Response Streaming

Gunjan
2 min readApr 26, 2023

--

Recently AWS announced AWS Lambda response streaming. This immediately caught my attention since I have previously grappled with websockets and RTMP quite a bit. I had also experimented with AWS lambda streaming so I wanted to know what was new.

However, I was mistaken . AWS Lambda response streaming is actually quite different from RTMP.

AWS Lambda Streaming is a serverless streaming service that can be used to stream audio and video over the internet. It supports RTMP and other such protocols.

AWS Lambda Response Streaming on the other hand is a brand new feature that allows Lambda functions to stream response payloads back to clients. This can benefit latency-sensitive applications by improving time to first byte (TTFB) performance. This is because you can send partial responses back to the client as they become available. This new feature can be used for a variety of purposes.

Response streaming can be used to process large amounts of data and send a response as it becomes available without having to buffer the entire response in memory. This can improve performance for web and mobile applications, and it can also be used to build functions that return larger payloads.

Response streaming is a powerful feature that can help build event-driven applications. We can use response streaming to build a function that processes a stream of data from an IOT sensor or a database.

Cost Implications

There is a charge for the number of bytes processed and streamed from the Lambda function and seems to be the same as what it is for a regular lambda execution. This includes the bytes in the request body, the response body, and any intermediate data that is processed by your function.The cost per byte is the same for both processed and streamed bytes.

In summary response streaming can increase the cost of your lambda functions. This is because regular lambdas are only charged by number of requests and execution time not by data processed and streamed.

Quick facts

  • The maximum number of concurrent threads is 10.
  • The maximum size of each request stream is 6 MB.
  • You can use the x-amzn-request-streams header to set the number of concurrent streams.
  • You can process each request stream independently.

Here are some of the resources I am using to run some experiments .

Thats all I have for now . Look out for posts with code samples in the future.

--

--

Gunjan
Gunjan

No responses yet