Story image

How AWS Lambda enables sharing common code between functions

03 Dec 18

AWS announced Lambda Runtime API and Lambda Layers, two new AWS Lambda features that enable developers to build custom runtimes, and share and manage common code between functions. 

Lambda supposedly makes it easy for developers to run code for virtually any type of application or back-end service.

The Runtime API for AWS Lambda defines a standardised HTTP-based specification which codifies how Lambda and a function’s runtime communicate. It enables users to build custom runtimes that integrate with Lambda to execute functions in response to events. 

By leveraging the Runtime API, businesses can use binaries or shell scripts, and their choice of programming languages and language versions. 

During an invoke, Lambda will bootstrap the user’s runtime code and communicate with it over Runtime API to execute the function code. With this release, AWS is also publishing a reference implementation of the C++ and Rust runtimes. Users can read more about the Runtime API in the Lambda documentation.

Lambda Layers are a new type of artifact that can contain arbitrary code and data and may be referenced by zero, one, or more functions at the same time. 

Lambda functions in a serverless application typically share common dependencies such as SDKs, frameworks, and now runtimes. With layers, users can centrally manage common components across multiple functions enabling better code reuse. 

To use layers, businesses simply put their common code in a zip file and upload it to Lambda as a layer. They can then configure their functions to reference it.

When a function is invoked, the layer contents become available to their function code. AWS is also providing a layer which includes the popular NumPy and SciPy scientific libraries for Python. These libraries were prebuilt and optimised for use in Lambda’s execution environment. 

By using this layer with Python functions, users can quickly get started with building complex data processing and machine learning applications.

Runtime API and Layers can be used independently. Users can also use them together to publish custom runtimes which can be then shared as layers.

They can also use the AWS Serverless Application Model (SAM) and SAM CLI to test, deploy and manage serverless applications that leverage Runtime API and Layers. 

With this release, several of AWS’ technology partners are also launching their offerings on top of Runtime API and Layers. 

Customers can author functions in new runtimes and layers, including those which support additional capabilities including application management, monitoring, and security.

Disruption in the supply chain: Why IT resilience is a collective responsibility
"A truly resilient organisation will invest in building strong relationships while the sun shines so they can draw on goodwill when it rains."
The disaster recovery-as-a-service market is on the rise
As time progresses and advanced technologies are implemented, the demand for disaster recovery-as-a-service is also expected to increase.
Cohesity signs new reseller and cloud service provider in Australia
NEXION Networks has been appointed as an authorised reseller of Cohesity’s range of solutions for secondary data.
The key to financial institutions’ path to digital dominance
By 2020, about 1.7 megabytes a second of new information will be created for every human being on the planet.
Proofpoint launches feature to identify most targeted users
“One of the largest security industry misconceptions is that most cyberattacks target top executives and management.”
What disaster recovery will look like in 2019
“With nearly half of all businesses experiencing an unrecoverable data event in the last three years, current backup solutions are no longer fit for purpose."
NVIDIA sets records with their enterprise AI
The new MLPerf benchmark suite measures a wide range of deep learning workloads, aiming to serve as the industry’s first objective AI benchmark suite.
McAfee named Leader in Magic Quadrant an eighth time
The company has been once again named as a Leader in the Gartner Magic Quadrant for Security Information and Event Management.