AWS Serverless Computing - cloudacademy

link

What is Serverless Computing

AWS Lambda - Function as a Service

Serverless = Don't worry with server-related tasks (delegate it to the cloud provider)

FaaS makes sense for event-based applications.

An event triggers the function, and then the function does something, putting the output of its computation somewhere else.

Strengths of Serverless Computing

Weakness of Serverless Computing

Limited runtime: Serverless doesn't play well with long running applications. In AWS Lambda the limit is 15min.

Testing is difficult because it's not that simple to replicate the "Serverless" infrastructure locally so you can test and troubleshoot your app. There are tools to help with this, though (SAM Framework).

Architectures that work well with Serverless

Event-driven architecture

Production > Detection > Consumption

AWS Serverless Computing - event-driven architecture.png

Microservice-based arechitecture

Monolith vs. Microservice

By separating the components of the monolith into microservices, these components can scale separately.

Understanding AWS Lambda to Run and Scale your Code

An Overview of AWS Lambda

cool fundamental video

Invoking a Lambda Function

Methods:

Each one of these 👆 methods go to the Lambda API. And the Lambda API provides three different invocation models:

Note

If an AWS Service invokes your function, you cannot select an invocation type. The AWS Service selects it for you.


Knowledge Check: Understanding AWS Lambda

Debugging

A developer has created a Lambda function to scrub real-time data of extraneous information and then send the scrubbed data to Kinesis for further processing and storage. Some of the data showing up in Kinesis seems to be inaccurate. What's the best way for the developer to debug this?

AWS X-Ray is the best solution to debugging a Lambda function.

Learn more: https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html

Permissions

A developer is creating a Lambda function that processes records in an Amazon DynamoDB stream. After quickly uploading the relevant code in the console, the developer runs the function and receives a permissions error. Where is the first place the developer should look?

The Lambda Execution Role is an AWS IAM role that grants the function permission to access specific AWS services and resources. In this case, the Execution Role must provide access to DynamoDB.

Invocation

When you invoke a Lambda function, the function is __. When a function is invoked by an AWS service event source, the function is __.

The hint here is the pre-determined term. Since I already memorized that we don't have control over the invocation type when the event source is an AWS Service.