AWS Lambda architecture brings serverless to enterprise cloud
A comprehensive collection of articles, videos and more, hand-picked by our editors
AWS Lambda enables developers to run code on demand -- without having to provision any servers. Amazon automatically...
manages running code in response to events and scales underlying resources; developers only need to worry about the actual code -- not what types of Elastic Compute Cloud instances to run or scale -- if a server needs to run at all.
Lambda's main advantage is simplicity, and companies don't need to spend money on unused resources when turning to serverless computing. Still, it can be confusing and complex to manage the function-based service, which can leave an enterprise searching for an AWS Lambda alternative. Lambda has some built-in features, such as versioning capabilities, but managing these versions without a tool set becomes incredibly complex. Fortunately, there are several utilities to help organizations manage Lambda code, versions and configurations.
Apex offers apex-shell, which enables arbitrary commands within a Lambda environment. It has a large focus on compatibility and uses a shell wrapper to allow the use of Lambda functions written in Go.
Apex focuses on two layers: the project layer and the function layer. Developers create a project, which is a group of functions. Some configurations are shared between projects, while individual functions can override configurations, as needed. Once configurations live in an Apex project directory, and have a project.json configuration and a functions directory with subdirectories for each function, Apex provides command-line tools for viewing logs, as well as deploying and invoking Lambda functions.
Apex is simple and provides little overhead for existing development. But because Apex packages each function separately, code that's shared between functions must be handled in a precommit hook. Apex also doesn't run commands, such as installing node modules, automatically. However, this is easy to add in the project.json file.
"build": "npm install --production",
"clean": "rm -rf node_modules"
The biggest downside of Apex is, currently, there's no way to execute or test a function within its framework before deploying it to AWS Lambda. If development is done in Node.js, then it's fairly easy to accomplish this using npm test scripts. But within the Apex framework, its invoke function invokes the live code on AWS Lambda -- not local code.
Serverless Inc. is a framework designed around AWS Lambda and Amazon API Gateway. Unlike Apex, Serverless offers many options for testing the framework offline; it also enables developers to easily integrate AWS Lambda with API Gateway. The framework enables IT teams to manage AWS Lambda functions, as well as an entire design methodology and framework for building a serverless application.
The Serverless framework replaces traditional back-end servers, allowing developers to build an entire web application using microservices architecture patterns by deploying individual functions to AWS Lambda. It allows an AWS user to place all code into a single repository and provides a simple way to deploy an update with one command.
Serverless is less useful for projects that aren't designed to use HTTP. Therefore, if an application isn't going to use API Gateway, it doesn't make much sense to use Serverless. But, overall, Serverless is worth considering based on the appeal of building and locally testing an application before deploying multiple functions to AWS Lambda.
Don't get locked in, find an AWS Lambda alternative
The biggest issue with tying a project into AWS Lambda is it locks that project to one provider. Applications using one of these frameworks may be stuck if organizational goals shift, but an enterprise can turn to an AWS Lambda alternative.
Google Cloud Functions launched shortly after AWS Lambda. Google released the new service and provided several open source tools to work with the API. As with AWS Lambda, IT teams can invoke functions directly or via events triggered from other sources. Google Cloud Functions is still in early beta, so developers need to request access before using it in development as an AWS Lambda alternative. As of now, Google Cloud Functions only supports Node.js.
Heroku, which runs on AWS, was incredibly popular before Docker was released. It's most comparable to Google App Engine, allowing a developer to build an entire application with multiple services in a more traditional environment. Heroku helps developers go from prototype to deployment, and it includes an autoscaling feature. Heroku could be a good fit for development teams getting started with a cloud-based framework.
Hook.io advertises itself as a web hook framework. AWS Lambda is essentially a way to run code in response to events, and a Webhook has the functionality. Hook.io supports Node.js, Python and an assortment of other programming languages that Lambda doesn't support. Hook.io is also open source, so it has less fear of vendor lock-in, but less corporate backing.
Many developers are starting to work with AWS Lambda. It's had more than a year to mature, and other cloud providers have essentially cloned its capabilities. And the addition of wrapper tools, like Apex and Serverless, make it easier to begin development of a serverless computing architecture with AWS Lambda.
AWS Lambda is head of the serverless pack
Avoid these common Lambda mistakes
Visualize a Lambda deployment to track serverless resources