DEV Community

Cover image for AWS Lambda in 3 Minutes
Justin Wheeler
Justin Wheeler

Posted on

AWS Lambda in 3 Minutes

Overview

AWS Lambda is a serverless compute service that executes provided code on fully managed infrastructure. It is classified as a Function-as-a-Service (FaaS), which means that everything, except your code, is managed for you.

That enables the many benefits:

Serverless

Serverless computing allows you to build and run applications and services without thinking about servers. With serverless computing, your application still runs on servers, but all the server management is done by AWS.

  • Better Availability
  • Better Performance
  • No Manual Scaling
  • No Patching
  • No Wasted Capacity

https://aws.amazon.com/lambda/faqs/

Configuration

Layers

Additional code that can be loaded into your function without the need to package that code along with your deployment package. This can be really useful if you have a lot of functions that rely on the same dependencies.

https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html

Memory

Controls the amount of memory a function can use.
Value must be between 128 and 10240 MB.

CPU scales proportional to memory

Timeout

Controls the amount of time a function can execute for.
Value must be less than 15 minutes.

long-running processes are not suited for Lambda

Invocation

Streaming

Synchronous

ALB Trigger

Asynchronous

S3 Trigger Example

services listed above are examples only and not a complete list https://docs.aws.amazon.com/lambda/latest/dg/lambda-services.html

Language Support

Lambda supports most popular programming languages natively, but still provides the ability to use any language by configuring a Runtime API or packaging your code as a Container.

  • C#
  • Go
  • Java
  • Node.js
  • PowerShell
  • Python
  • Ruby

Deployment

With serverless applications traditional processes and methods will not work. There are frameworks that exist to solve these types of problems.

Here are my two favorite frameworks:

https://geekflare.com/serverless-apps-frameworks/

Walkthrough Guides

AWS Console
https://aws.amazon.com/getting-started/hands-on/run-serverless-code/

AWS SAM
https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-getting-started-hello-world.html

AWS Serverless Workshops
https://data-processing.serverlessworkshops.io/

The Serverless Application Framework (sls)
https://www.serverless.com/framework/docs/providers/aws/examples/hello-world/node/

Top comments (0)