AWS Lambda

Last updated
AWS Lambda
Developer(s) Amazon.com
Initial releaseNovember 13, 2014;9 years ago (2014-11-13)
Operating system Cross-platform
Available inEnglish
Website aws.amazon.com/lambda   OOjs UI icon edit-ltr-progressive.svg

AWS Lambda is an event-driven, serverless computing platform provided by Amazon as a part of Amazon Web Services. It is designed to enable developers to run code without provisioning or managing servers. It executes code in response to events and automatically manages the computing resources required by that code. It was introduced on November 13, 2014. [1]

Contents

Node.js, Python, Java, Go, [2] Ruby, [3] and C# (through .NET) are all officially supported as of 2018. In late 2018, custom runtime support [4] was added to AWS Lambda.

AWS Lambda supports running native Linux executables by calling them from a supported runtime, such as Node.js. [5]

AWS Lambda was primarily designed for tasks such as handling image and object uploads to Amazon S3, updating DynamoDB tables, responding to website clicks and reacting to sensor readings from IoT connected devices. AWS Lambda can also be used to automatically provision back-end services triggered by custom HTTP requests, and "spin down" such services when not in use to save resources. These custom HTTP requests are configured in AWS API Gateway, which can also handle authentication and authorization in conjunction with AWS Cognito.

Unlike Amazon EC2, which is billed by the second (with a minimum of 60 seconds), AWS Lambda is billed by the millisecond with no minimum.

AWS Lambda functions are often used in association with AWS SQS queues to process asynchronous tasks in distributed architectures.

In 2019, at the AWS annual cloud computing conference (AWS re:Invent), the AWS Lambda team announced "Provisioned Concurrency", a feature that "keeps functions initialized and hyper-ready to respond in double-digit milliseconds." [6] The Lambda team described Provisioned Concurrency as "ideal for implementing interactive services, such as web and mobile backends, latency-sensitive microservices, or synchronous APIs." [7]

Specification

Each AWS Lambda instance is a container created from Amazon Linux AMIs (a Linux distribution related to RHEL) with 128–10240 MB of RAM (in 1 MB increments), [8] 512 MB to 10 GB of ephemeral storage in /tmp folder, [9] and a configurable execution time from 1 to 900 seconds. Ephemeral storage remains locally available only for the duration of the instance and is discarded after all tasks running on the instance are complete.

Since December 2020, Lambda has been capable of supporting Docker containers through ECR up to 10 GB in size. [10]

AWS Lambda Function URL

The Lambda Function URL gives Lambda a unique and permanent URL which can be accessed by authenticated and non-authenticated users alike. [11] It was launched in April 6, 2022 by the AWS Lambda team. [12]

Format

A typical function URL has the following format: [11]

https://<url-id>.lambda-url.<region>.on.aws 

History

Before Function URLs, Lambda functions could be invoked only using AWS Lambda APIs or Amazon API Gateway. [13] Response streaming was also made possible with function URLs. [14]

Pricing

There are no extra charges included with invoking a Function URL, other than the duration and requests. [15] Function URLs are included in Lambda’s request and duration pricing. [16]

Caution with a public function URL

If a Lambda function URL is made publicly available with AuthType = NONE, it will warrant unauthenticated access to the Lambda function. [17] It can lead to a DDoS attack, which will incur costs to the AWS account which is hosting the Lambda function.

AWS Lambda Layers

AWS Lambda Layers allow developers to easily manage and share common components across multiple Lambda functions. It's designed to promote code reusability and simplify the deployment of libraries, custom runtimes, and other dependencies that Lambda functions might need. Lambda Layers can be particularly useful in microservices architectures, where multiple functions might share the same dependencies. [18] By using layers, one can ensure that all functions are using the same version of a library, making the application more consistent and easier to manage.

A Lambda Layer is a .zip file archive that allows to package and deploy common components separately from a Lambda function code. [19] A single AWS Lambda function can include up to five layers at a time. The layers are applied in a specified order, allowing later layers to override the content of earlier ones if there are conflicts. [20] This layering system can significantly reduce the size of Lambda deployment packages, as there is no need to include these common components in every function's deployment package.

Usage

Create a Lambda Layer: One first creates a layer by packaging libraries or other dependencies into a .zip file and then uploading it to Lambda. [21] The runtimes that the layer is compatible with can be specified when creating a layer. [22]

Add the Layer to Lambda Functions: When creating or updating a Lambda function, the layers to be included in the function can be specified. The Lambda service will then merge function code with the specified layers to create the execution environment. [23]

Versioning: Each time a new version of a layer is published, it receives a unique version number. [24] This is useful for managing updates to layers separately from function code. It also ensures that functions can continue using older versions of a layer if needed.

Sharing Layers: Layers can be shared across different AWS accounts or made public to the broader AWS community. [25] This is particularly useful for commonly used libraries or runtime extensions.

See also

Related Research Articles

Amazon S3 or Amazon Simple Storage Service is a service offered by Amazon Web Services (AWS) that provides object storage through a web service interface. Amazon S3 uses the same scalable storage infrastructure that Amazon.com uses to run its e-commerce network. Amazon S3 can store any type of object, which allows uses like storage for Internet applications, backups, disaster recovery, data archives, data lakes for analytics, and hybrid cloud storage. AWS launched Amazon S3 in the United States on March 14, 2006, then in Europe in November 2007.

<span class="mw-page-title-main">Amazon Elastic Compute Cloud</span> Cloud computing platform

Amazon Elastic Compute Cloud (EC2) is a part of Amazon.com's cloud-computing platform, Amazon Web Services (AWS), that allows users to rent virtual computers on which to run their own computer applications. EC2 encourages scalable deployment of applications by providing a web service through which a user can boot an Amazon Machine Image (AMI) to configure a virtual machine, which Amazon calls an "instance", containing any software desired. A user can create, launch, and terminate server-instances as needed, paying by the second for active servers – hence the term "elastic". EC2 provides users with control over the geographical location of instances that allows for latency optimization and high levels of redundancy. In November 2010, Amazon switched its own retail website platform to EC2 and AWS.

<span class="mw-page-title-main">Cloud computing</span> Form of shared internet-based computing

Cloud computing is the on-demand availability of computer system resources, especially data storage and computing power, without direct active management by the user. Large clouds often have functions distributed over multiple locations, each of which is a data center. Cloud computing relies on sharing of resources to achieve coherence and typically uses a pay-as-you-go model, which can help in reducing capital expenses but may also lead to unexpected operating expenses for users.

<span class="mw-page-title-main">AppScale</span> American cloud infrastructure software company

AppScale is a software company offering cloud infrastructure software and services to enterprises, government agencies, contractors, and third-party service providers. The company commercially supports one software product, AppScale ATS, a managed hybrid cloud infrastructure software platform that emulates the core AWS APIs. In 2019, the company ended commercial support for its open-source serverless computing platform AppScale GTS, but AppScale GTS source code remains freely available to the open-source community.

Amazon Relational Database Service is a distributed relational database service by Amazon Web Services (AWS). It is a web service running "in the cloud" designed to simplify the setup, operation, and scaling of a relational database for use in applications. Administration processes like patching the database software, backing up databases and enabling point-in-time recovery are managed automatically. Scaling storage and compute resources can be performed by a single API call to the AWS control plane on-demand. AWS does not offer an SSH connection to the underlying virtual machine as part of the managed service.

Backend as a service (BaaS), sometimes also referred to as mobile backend as a service (MBaaS), is a service for providing web app and mobile app developers with a way to easily build a backend to their frontend applications. Features available include user management, push notifications, and integration with social networking services. These services are provided via the use of custom software development kits (SDKs) and application programming interfaces (APIs). BaaS is a relatively recent development in cloud computing, with most BaaS startups dating from 2011 or later. Some of the most popular service providers are AWS Amplify and Firebase.

<span class="mw-page-title-main">GraalVM</span> Virtual machine software

GraalVM is a Java Development Kit (JDK) written in Java. The open-source distribution of GraalVM is based on OpenJDK, and the enterprise distribution is based on Oracle JDK. As well as just-in-time (JIT) compilation, GraalVM can compile a Java application ahead of time. This allows for faster initialization, greater runtime performance, and decreased resource consumption, but the resulting executable can only run on the platform it was compiled for. It provides additional programming languages and execution modes. The first production-ready release, GraalVM 19.0, was distributed in May 2019. The most recent release is GraalVM for JDK 22, made available in March 2024.

Kubernetes is an open-source container orchestration system for automating software deployment, scaling, and management. Originally designed by Google, the project is now maintained by a worldwide community of contributors, and the trademark is held by the Cloud Native Computing Foundation.

In software engineering, a microservice architecture is a variant of the service-oriented architecture structural style. It is an architectural pattern that arranges an application as a collection of loosely coupled, fine-grained services, communicating through lightweight protocols. One of its goals is that teams can develop and deploy their services independently of others. This is achieved by the reduction of several dependencies in the code base, allowing developers to evolve their services with limited restrictions from users, and for additional complexity to be hidden from users. As a consequence, organizations are able to develop software with fast growth and size, as well as use off-the-shelf services more easily. Communication requirements are reduced. These benefits come at a cost to maintaining the decoupling. Interfaces need to be designed carefully and treated as a public API. One technique that is used is having multiple interfaces on the same service, or multiple versions of the same service, so as to not disrupt existing users of the code.

<span class="mw-page-title-main">RESTHeart</span>

RESTHeart is a Java open source Low code micro-services Open Platform.

The Serverless Framework is a free and open-source web framework written using Node.js. Serverless is the first framework developed for building applications on AWS Lambda, a serverless computing platform provided by Amazon as a part of Amazon Web Services. Currently, applications developed with Serverless can be deployed to other function as a service providers, including Microsoft Azure with Azure Functions, IBM Bluemix with IBM Cloud Functions based on Apache OpenWhisk, Google Cloud using Google Cloud Functions, Oracle Cloud using Oracle Fn, Kubeless based on Kubernetes, Spotinst and Webtask by Auth0.

This is a timeline of Amazon Web Services, which offers a suite of cloud computing services that make up an on-demand computing platform.

Serverless computing is a cloud computing execution model in which the cloud provider allocates machine resources on demand, taking care of the servers on behalf of their customers. "Serverless" is a misnomer in the sense that servers are still used by cloud service providers to execute code for developers. However, developers of serverless applications are not concerned with capacity planning, configuration, management, maintenance, fault tolerance, or scaling of containers, VMs, or physical servers. When an app is not in use, there are no computing resources allocated to the app. Pricing is based on the actual amount of resources consumed by an application. It can be a form of utility computing.

Function as a service (FaaS) is a category of cloud computing services that provides a platform allowing customers to develop, run, and manage application functionalities without the complexity of building and maintaining the infrastructure typically associated with developing and launching an app. Building an application following this model is one way of achieving a "serverless" architecture, and is typically used when building microservices applications.

<span class="mw-page-title-main">Netlify</span> American cloud computing company

Netlify is a remote-first cloud computing company that offers a development platform that includes build, deploy, and serverless backend services for web applications and dynamic websites. The platform is built on open web standards, making it possible to integrate build tools, web frameworks, APIs, and various web technologies into a unified developer workflow.

<span class="mw-page-title-main">IBM Cloud</span> Cloud computing services provided by IBM

IBM Cloud is a set of cloud computing services for business offered by the information technology company IBM.

AWS Glue is an event-driven, serverless computing platform provided by Amazon as a part of Amazon Web Services. It is a computing service that runs code in response to events and automatically manages the computing resources required by that code. It was introduced in August 2017.

<span class="mw-page-title-main">Dapr</span> Event-driven, portable runtime for building microservices on cloud and edge

Dapr is a free and open source runtime system designed to support cloud native and serverless computing. Its initial release supported SDKs and APIs for Java, .NET, Python, and Go, and targeted the Kubernetes cloud deployment system.

The AWS Cloud Development Kit is an open-source software development framework developed by Amazon Web Services (AWS) for defining and provisioning cloud infrastructure resources using familiar programming languages. The AWS CDK aims to improve the experience of working with Infrastructure as Code by providing higher-level, reusable constructs that enable developers to create and manage AWS resources more efficiently and with less boilerplate code compared to traditional configuration files like AWS CloudFormation templates.

AWS App Runner is a fully managed container application service offered by Amazon Web Services (AWS). Launched in May 2021, it is designed to simplify the process of building, deploying, and scaling containerized applications for developers. The service enables users to focus on writing code and developing features, without needing to manage the underlying infrastructure. It provides automatic scaling, load balancing, and security features, making it a suitable choice for deploying web applications and APIs. The service also simplifies MLOps.

References

  1. Barr, Jeff (November 13, 2014). "AWS Lambda – Run Code in the Cloud". AWS News Blog. Retrieved August 29, 2022.
  2. Munns, Chris (January 15, 2018). "Announcing Go Support for AWS Lambda". Amazon Web Services. Retrieved December 10, 2019.
  3. Munns, Chris (November 29, 2018). "Announcing Ruby Support for AWS Lambda". Amazon Web Services. Retrieved December 10, 2019.
  4. "AWS Lambda Now Supports Custom Runtimes and Enables Sharing Common Code Between Functions". Amazon Web Services. November 29, 2018. Retrieved December 10, 2019.
  5. Wagner, Tim (April 15, 2015). "Running Arbitrary Executables in AWS Lambda". AWS Compute Blog. Retrieved December 10, 2019.
  6. "New – Provisioned Concurrency for Lambda Functions". aws.amazon.com. 3 December 2019. Retrieved 2020-10-12.
  7. "New – Provisioned Concurrency for Lambda Functions". Amazon Web Services. 2019-12-03. Retrieved 2020-02-03.
  8. "AWS Lambda now supports up to 10 GB of memory and 6 vCPU cores for Lambda Functions". About AWS. December 1, 2021. Retrieved January 29, 2021.
  9. Yun, Channy (24 March 2022). "AWS Lambda Now Supports Up to 10 GB Ephemeral Storage". AWS News Blog. Retrieved 1 April 2022.
  10. "New for AWS Lambda – Container Image Support". Amazon Web Services. 2020-12-01. Retrieved 2021-06-03.
  11. 1 2 "Lambda function URLs - AWS Lambda". docs.aws.amazon.com. Retrieved 2024-03-01.
  12. "Document history - AWS Lambda". docs.aws.amazon.com. Retrieved 2024-03-01.
  13. "Invoking Lambda functions - AWS Lambda". docs.aws.amazon.com. Retrieved 2024-03-01.
  14. "Configuring a Lambda function to stream responses - AWS Lambda". docs.aws.amazon.com. Retrieved 2024-03-01.
  15. "Serverless Computing – AWS Lambda Pricing – Amazon Web Services". Amazon Web Services, Inc. Retrieved 2024-03-01.
  16. "Announcing AWS Lambda Function URLs: Built-in HTTPS Endpoints for Single-Function Microservices | AWS News Blog". aws.amazon.com. 2022-04-06. Retrieved 2024-03-01.
  17. "Security and auth model for Lambda function URLs - AWS Lambda". docs.aws.amazon.com. Retrieved 2024-03-01.
  18. "Building Serverless SaaS Microservices with AWS Lambda Layers | AWS Partner Network (APN) Blog". aws.amazon.com. 2022-08-11. Retrieved 2024-02-02.
  19. "Working with Lambda layers - AWS Lambda". docs.aws.amazon.com. Retrieved 2024-02-02.
  20. "Adding layers to functions - AWS Lambda". docs.aws.amazon.com. Retrieved 2024-02-02.
  21. "Packaging your layer content - AWS Lambda". docs.aws.amazon.com. Retrieved 2024-02-02.
  22. "Creating and deleting layers in Lambda - AWS Lambda". docs.aws.amazon.com. Retrieved 2024-02-02.
  23. "Adding layers to functions - AWS Lambda". docs.aws.amazon.com. Retrieved 2024-02-02.
  24. "Working with Lambda layers - AWS Lambda". docs.aws.amazon.com. Retrieved 2024-02-02.
  25. "Sharing Lambda Layers - AWS Serverless Application Repository". docs.aws.amazon.com. Retrieved 2024-02-02.