Lambda Flashcards
What are the types and the differences between two types of lambda invocations?
Sync invocation:
- result is returned right away
- every time it is user triggered
- error handling client side
Async invocation:
- events are placed in an event queue
- lambda attempts to retry on fail (3 times)
- can define a DLQ for failed processing
What is lambda event source mapping?
It is a way to integrate with other AWS services that will invoke AWS lambda synchronously every time a batch is returned from the service. Lambda keeps polling for data every time.
Compatible with Dynamo Streams, SQS, SNS and kinesis. Provides auto scaling
What are lambda destinations?
It is a way to send, asynchronously succesful and failed events triggered from AWS lambda. Can act as a DLQ.
What is a lambda edge function and when you should use it?
Code that you write and attach to cloudfront. Should be used when you need to minimize latency.
What happens if a request is made and the limit of concurrent executions is reached?
Each invocation over the limit will trigger a throttle, that will return 429 if the request is sync and retry automatically and go to dlq if async.
What is provisioned concurrency and when to use it?
It is a way to prevent cold start from happening, by leveraging lambda functions before they are invoked, using ASG
What are lambda versions and aliases?
A lambda version is created when the function is published and it is immutable. An alias is a pointer to a lambda version, so we can call $LATEST with a DEV alias, v1 with a PROD alias, etc, etc. This way it is easier to provide URLs to the lambdas