BT

InfoQ Homepage News AWS Lambda Layers and Runtime API: beyond Officially Supported Runtimes

AWS Lambda Layers and Runtime API: beyond Officially Supported Runtimes

This item in japanese

Bookmarks

AWS re:Invent 2018 had numerous announcements of new features and services, including Lambda Layers, to centrally manage code and data shared across functions, and the Lambda Runtime API, expanding AWS Lambda beyond the list of officially supported runtimes like JavaScript, Java and C# to any programming language.

Before Lambda Layers, it was necessary to package and deploy shared code with all functions using it. Instead, Lambda Layers allow developers to place common components in a zip file and upload the resource as a Lambda Layer.

Layers generally work predictably. For example, Layers may be versioned to manage updates, and each version is immutable. When configuring a function, it can reference up to five layers, one of which may be a runtime. The order in which layers get invoked is relevant as each layer could overwrite functionality in the previous layer. Danilo Poccia, technical evangelist at Amazon Web Services, explains:

The first layer can be a runtime and the second layer adds specific versions of the libraries you need.

Lambda Layers allow developers to enforce separation of concerns between dependencies and custom business logic, make function code more focused, and accelerate deployments as dependencies may get reused.

The AWS team provides a few example layers including NumPy and SciPy, popular scientific libraries for Python, to help accelerate developer efforts for data processing and machine learning applications. Third parties provide Lambda Layers for application monitoring, security, and management.

AWS Lambda Layers provide the foundation for the even more significant announcement, which is that Lambda code can now leverage a non-JavaScript runtime. The Runtime API layer provides communication between source code in an alternative programming language and the Lambda environment, or other JavaScript environments such as the N|Solid Node.js Lambda Runtime environment from NodeSource.

Communication between a runtime bootstrap uses an HTTP-based interface to get an event payload for a new invocation, returning the response from the function.

With the initial announcement, there are C++, Ruby, and Rust runtime environments available now. AWS is working with partners on environments for other runtimes including Erlang (Alert Logic), Elixir (Alert Logic), Cobol (Blu Age), Node.js (NodeSource N|Solid), and PHP (Stackery). Additional languages for the future should use the Lambda Runtime API.

Community support has been positive with the initial Lambda Runtime announcement. Kelsey Hightower, staff developer advocate at Google, explains his experience with Lambda Runtime on Twitter:

After building my first custom Lambda runtime, it's safe to say AWS hit a home run, the Lambda Runtime API is a game changer. Given the combination of the Lambda Runtime API and Lambda Layers, I no longer believe adding support for containers would add any additional benefit to Lambda. The Lambda Runtime API provides a major benefit over containers for Serverless workloads: a well defined and opinionated runtime API for getting work done.

AWS Lambda Layers and Runtime may get used via the AWS console or AWS CLI. The AWS Serverless Application Model (SAM) and the SAM CLI may also get used to test, deploy and manage applications with these new Lambda features.

Rate this Article

Adoption
Style

Educational Content

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

  • A betting man ...

    by Cameron Purdy /

    Your message is awaiting moderation. Thank you for participating in the discussion.

    I watch with fascination how Amazon layers cruft upon cruft, assuming that the law of systems entropy will somehow pass them by.

    At some point, the cost of continuing to spin this aggregate tar ball will necessarily exceed the resources of the company. Fortunately, the resources are so plentiful that the day of reckoning is deferred for at least a decade.

    Peace.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

BT

Is your profile up-to-date? Please take a moment to review and update.

Note: If updating/changing your email, a validation request will be sent

Company name:
Company role:
Company size:
Country/Zone:
State/Province/Region:
You will be sent an email to validate the new email address. This pop-up will close itself in a few moments.