RequestResponse is the default, providing synchronous calls.
{ 3/12 }
If you're passing ๐๐๐ฒ๐ป๐, the invocation will be triggered asynchronously.
If used in another function, the code execution will just continue after submitting the call.
๐ก If your function returns an error, AWS will automatically ๐ฟ๐ฒ๐๐ฟ๐ the invoke ๐๐๐ถ๐ฐ๐ฒ
{ 4/12 }
Let's have a more detailed look at the most common Lambda triggers: ๐๐ฃ๐ ๐๐ฎ๐๐ฒ๐๐ฎ๐๐, ๐ฆ๐ฏ, and ๐๐๐ป๐ฎ๐บ๐ผ๐๐ ๐๐ฎ๐ฏ๐น๐ฒ ๐๐๐ฟ๐ฒ๐ฎ๐บ๐.
They can be found in a lot of widely used architectural patterns.
Invocations by API Gateway are synchronous ones, waiting for your Lambda to return a response it can send back to the requesting client.
You need to explicitly map which invocation paths you want to map to with function.
{ 6/12 }
๐ฆ๐ฏ ๐ง๐ฟ๐ถ๐ด๐ด๐ฒ๐ฟ
Events occur when the content in an S3 bucket is modified, e.g. by creating, removing, or updating a file.
When defining an event, youโre able to specify what sort of action will trigger the lambda function and which paths you want to include
If streams are enabled for a table, all changes are pushed into such a stream if there were changes made to an item or a new item was inserted.
Think of it like a line or a queue through which the data flows.
{ 8/12 }
If there's data inside that stream, a Lambda function will be triggered with related data.
The stream data can be ๐ฎ๐ด๐ด๐ฟ๐ฒ๐ด๐ฎ๐๐ฒ๐ฑ, meaning that a single Lambda invocation can contain ๐บ๐๐น๐๐ถ๐ฝ๐น๐ฒ change records.
Invocations are asynchronous like at S3.
{ 9/12 }
There are a lot of other ๐๐๐ป๐ฐ๐ต๐ฟ๐ผ๐ป๐ผ๐๐ ๐ฒ๐๐ฒ๐ป๐ ๐๐ผ๐๐ฟ๐ฐ๐ฒ๐...
โข Elastic Load Balancing (ALB)
โข Cognito
โข Alexa
โข API Gateway
โข CloudFront
โข Kinesis Data Firehose
โข Simple Storage Service Batch
โข Amazon Connect
โข Amazon Lex
{ 10/12 }
... and also ๐ฎ๐๐๐ป๐ฐ๐ต๐ฟ๐ผ๐ป๐ผ๐๐ ones!
If you're more interested in Lambda triggers and what architectural patterns you can build with them, have a look at the ๐๐ผ๐บ๐ฝ๐น๐ฒ๐๐ฒ ๐๐๐ถ๐ฑ๐ฒ ๐๐ผ ๐๐ฎ๐บ๐ฏ๐ฑ๐ฎ ๐ง๐ฟ๐ถ๐ด๐ด๐ฒ๐ฟ๐ ๐ฎ๐ป๐ฑ ๐๐ฒ๐๐ถ๐ด๐ป ๐ฃ๐ฎ๐๐๐ฒ๐ฟ๐ป๐ by @thedashbird ๐
โข Fan-in & Fan-out
โข Simple Web Service
โข Publish/Subscribe
โข Strangler
โข Aggregator
{ 1/7 }
๐๐ฎ๐ป-๐ถ๐ป & ๐๐ฎ๐ป-๐ผ๐๐
Common problem: large tasks that are exceeding Lambda's execution time limit
With Fan-out, you're splitting those large tasks into small ones and delegating those to Lambda workers.
Afterward, results are aggregated (= Fan-in).
๐๐ฒ๐'๐ ๐ฏ๐ฒ ๐ต๐ผ๐ป๐ฒ๐๐: generally, debugging is not a fun task ๐คข
Especially for serverless, event-driven & distributed systems.
From Lambda's logging basics to ๐๐ฎ๐๐ถ๐ป๐ด ๐๐ถ๐บ๐ฒ & ๐ป๐ฒ๐ฟ๐๐ฒ๐ โ
Lambda's a serverless technology provided by AWS.
But that ๐ฑ๐ผ๐ฒ๐๐ป'๐ ๐บ๐ฒ๐ฎ๐ป that there are no servers.
In the background, there are countless micro-containers running on top of the traditional servers.
Where do all the logs of those containers go to?
By default, they will end up in CloudWatch.
Every Lambda will receive its own ๐น๐ผ๐ด ๐ด๐ฟ๐ผ๐๐ฝ.
Like a repository for logs.
Not only that, every micro-container will create a new so-called ๐น๐ผ๐ด ๐๐๐ฟ๐ฒ๐ฎ๐บ.
Think of it as a text file where logs are written to.
It's managed, highly available & scales on-demand with low latencies.
For getting you hooked, at Prime Days 2021 DynamoDB served ๐ด๐ต.๐ฎ ๐บ๐ถ๐น๐น๐ถ๐ผ๐ป ๐ฟ๐ฒ๐พ๐๐ฒ๐๐๐/๐๐ฒ๐ฐ๐ผ๐ป๐ฑ at its peak.
I'm still in the early stages & already got a lot of lessons learned โ
๐๐ฎ๐๐ป๐ฐ๐ต ๐ฒ๐ฎ๐ฟ๐น๐
Maybe you've got another dozen ideas for features you think are needed for your MVP.
But until you've launched and you've got actual (paying) users, you've got no guarantee that your business case is even valid.
Intersects with the previous point: don't make the shinest code, with 100% code coverage and the perfect architecture, as it requires way too much effort.
Don't over or underdo it.
Make it work & manageable.