Serverless Computing II

In part I, I’ve described Serverless Computing in detail with an example. In this post, I’ll start by describing serverless platforms and toolkits and continue with comparing some of them to each other.

B. Serverless Platform

Cloud providers offer Serverless platforms which are ready to develop and deploy a serverless application. Most popular platforms are introduced below:

  • AWS Lambda

  • Azure Function

  • Google Function

  • IBM Cloud function which is based on Apache OpenWhisk

  • Alibaba cloud function

  • Apache OpenWhisk is an open source cloud platform that executes functions in response to events at any scale [9].

  • Nuclio is extremely fast. A single function instance can process hundreds of thousands of HTTP requests or data records per second. This is 10-100 times faster than some other frameworks [10].

  • PubNub Functions is a serverless environment to execute functions on the edge, transforming, enriching, and filtering messages as they route through the PubNub network [11].

  • OpenFaas is a framework for building serverless functions with Docker and Kubernetes [12].

  • Fnproject is an open-source container-native serverless platform that you can run anywhere — any cloud or on-premise. It’s easy to use, supports every programming language, and is extensible and performant [13].

  • Kubeless is a Kubernetes-native serverless framework that lets you deploy small bits of code (functions) without having to worry about the underlying infrastructure [14].

  • Fission is an open-source FaaS serverless framework for Kubernetes. Short-lived functions can be written in any language, and map them to HTTP requests (or other event triggers) [15].

  • Iron.io provides IronFunctions which is a container based distributed work-on-demand platform [16].

  • Funktion is an open-source event-driven lambda style programming model designed for Kubernetes [17].

C. Serverless Toolkit

A serverless toolkit is an application which can be used for development, test, and deployment of the FaaS applications for serverless platforms. There are lots of toolkits for developing and deploying a serverless application in different cloud providers which some of which are listed below:

  • AWS SAM [18], the AWS Serverless Application Model is a model to define serverless applications. AWS SAM is natively supported by AWS CloudFormation and defines a simplified syntax for expressing serverless resources. It doesn’t have state management. It is feature completeness because it comes from AWS.

  • Serverless Framework [19] is a single toolkit for deploying serverless architectures to AWS, Microsoft Azure, IBM OpenWishk, Google Cloud, etc.

  • Weblab [20] provides CLI, and the code can be easily deployed to their servers.

  • SpringCloud Functions [21] is a uniform programming model across serverless providers.

  • Zappa [22] makes it super easy to build and deploy serverless, event-driven Python applications (including, but not limited to, WSGI web apps) on AWS Lambda plus API Gateway.

  • Node Lambda [23] is JS-based toolkit for implementing lambda functions for AWS.

  • Gordon [24] is a tool to create, wire and deploy AWS Lambdas using CloudFormation. It supports APIGateway, Scheduled CloudWatch Events (cron), CloudWatch Events, Dynamodb Streams, Kinesis Streams, S3.

  • Kappa [25] provides a CLI for deploying, updating and testing the lambda functions.

  • ng-toolkit [26] uses Angular for developing and deploying of serverless function on GC, AWS, and firebase.

  • Algorithmia [27] provides some interesting features for FaaS like Machine Learning.

  • Clay [28] is the easiest way to get your backend code instantly running and accessible at a secure HTTPS URL.

  • LambCI [29] is a small package which can be uploaded to your AWS Lambda and is triggered when you push new code or push existing requests on GitHub and run tests.

  • lambda-uploader [30] Provides a quick command line utility for packaging and publishing Python AWS Lambda functions.

  • Terraform [31] has advantages like Rolling back to the previous state because it has state management capability.

  • Apex [32] lets you build, deploy and manage AWS Lambda functions with ease. It also supports languages like Golang which was not supported for developing by AWS Lambda.

  • chalice [33] is a python serverless microframework for AWS which provides CLI for creating, deploying and managing the application. It also has the capability of automatic IAM policy generation.

  • claudiajs [34] is a Nodejs project for AWS and has some negative sides in State, Rollback and error handling.

  • Serverless express [35] runs serverless applications and REST APIs using your existing Node.js application framework, on top of AWS Lambda and Amazon API Gateway.

  • Serverless java container [36] is a Java wrapper to run Java applications written with Spring, Jersey, Spark framework inside AWS Lambda.

  • Sparta [37] transforms a go binary’s registered lambda functions into a set of independently addressable AWS Lambda functions. It has some functionality like dynamically creating a CloudFormation template to either create or update the service state.

In the following section, the aforementioned serverless platforms and toolkits will be compared.

Comparison

Serverless Platforms

In the last section, the most used serverless platforms are introduced and here they will be compared with respect to their functionalities. Table I represents the comparison of these serverless platforms and their key features with each other.

Serverless platform Open Source Supported Platform Supported Language Performance by Language Free tier Orchestration
AWS Lambda No AWS Node.js, Python, Java, C#, Go Java[41] 1 Mio Free/month AWS Step Functions
Azure Function No Microsoft Azure C#, Node.js, F#, Java C#[40] 1 Mio Free/month Azure Logic Apps
Google Function No Google Cloud Node.js, Python, Java, C#, Go, PHP, Ruby Python & Node.js[40] 2 Mio Free/month Unknown
IBM Cloud function No IBM Cloud Node.js, Python, Java, Swift, Go, PHP Python[40] Free Unknown
Apache OpenWhisk yes Any, AWS, GC, IBM,… Node.js, Python, Java, Swift, Go, PHP Python[40] Free Unknown
Alibaba cloud function No Alibaba Cloud C, C++, C#, Java, Node.js, Python, PHP, Perl 1 Mio Free/month Unknown
Nuclio yes Any, AWS, GC, IBM,… Node.js, Python, Java, C#, Go, shell Free Kubernetes
PubNub Functions No Any, AWS, GC, IBM,… Javascript 1 Mio Free/month Unknown
OpenFaas yes Any, AWS, GC, IBM,… Node.js, CoffeeScript, Golang, Python, Java, Busybox/shell, R, .NET Free Kubernetes, Docker Swam
Fnproject yes Any, AWS, GC, IBM,… Java, Go, Python, Node.js Free Fn Flow [42]
Kubeless yes Any but on top of Kubernetes Python, NodeJS, Ruby, PHP Free Kubernetes
Fission yes Any Any but currently NodeJS, Python, Ruby, Go, PHP, Bash Free Kubernetes
Iron.io, IronFunction yes Any Any No Kubernetes, Docker Swam
Funktion yes Any but on top of Kubernetes Any Free Flow Language [43], Kubernetes


Table I: Comparison of serverless Platforms

Please leave a comment if you want a performance test by languages for other platforms. Microsoft Azure supports Python, PHP, TypeScript, Batch (.cmd, .bat), Bash and PowerShell but in Experimental mode. The experimental languages in 1.x [38] don’t scale well and don’t support all bindings. For example, Python is slow because the Functions runtime runs python.exe with each function invocation. And while Python supports HTTP bindings, it can’t access the request object.

It is important to consider that Alibaba Cloud function is the only platform which supports C and C++ programming languages while these two languages are used commonly. Apart from that, it is not open source and doesn’t offer free invocations. Also, as mentioned in Table I, all platforms are supporting Node.js, whereas PHP is not supported which also indicates, the popularity of Node.js and Javascript for a serverless application.

Serverless Toolkits

For developing and deploying serverless applications to these platforms, serverless toolkits can be used, some of which with their features have been introduced earlier. Also, they have some key features like open source, supported programming languages, etc. which are compared and shown in Table II.

Serverless Toolkit Open Source Programming Languages Supported Platform Price
AWS SAM yes Node.js, Python, Java, C#, Go AWS $0
Serverless Framework yes Node.js Any $0
Weblab No Node.js, Python, Java, C#, Go AWS $0 – $150/month
SpringCloud yes Node.js, Python, Java, C#, Go AWS $0
Zappa Yes Python AWS $0
SLAppForge, Sigma No Javascript AWS, GC $0 – $7/month
Node Lambda Yes Python, Javascript, java AWS $0
Kappa Yes Node.js, Python, Java, C#, Go AWS $0
Algorithmia No Any AWS, cloudflare 10,000 credits $1
ng-toolkit Yes Any AWS, GC, Firebase $0
Gordon Yes Any AWS $0
Clay Yes Any AWS, GC, Azure $0
LambCI Yes Any AWS $0
lambda-uploader Yes Python AWS $0
Terraform No Javascript AWS From $0
Apex Yes Node.js, Python, Java, Rust, Clojure, Go AWS $0
chalice Yes Python AWS $0
claudiajs Yes Nodejs AWS $0
Serverless express Yes Nodejs AWS $0
Serverless java container Yes Java AWS $0
Sparta Yes Go AWS $0


Table II: Comparison of serverless toolkits

Among these toolkits, Serverless framework is well known, open source and currently is supporting AWS, Microsoft Azure, IBM OpenWhisk, Google Cloud, Kubeless, Spotinst, webtasks and Fnproject. It is also well documented and provides a variety of examples for different platforms. By considering that most serverless platforms are supporting Node.js, accordingly, most serverless toolkits will also support that.

Besides serverless toolkits, there are also some testing tools for FaaS, one of which is SAM Local and developed by AWS for testing AWS Lambda. SAM Local makes it possible to test serverless applications locally but its CLI is not mature enough and is somehow buggy, in fact, it is in beta version [39]. Also, invoking the AWS Lambda functions is another way of testing AWS Lambda.

AWS Lambda, Google Cloud function, Azure function, and IBM Cloud function

In the following, the comparison of FaaS between AWS Lambda, Google Cloud function, Azure function, and IBM Cloud function will be presented. This comparison has been done also in [40] and has been expanded by adding three other parameters, namely concurrent execution, logging, and integrations for aforementioned providers which are shown in Table III.

Item AWS Lambda Azure Function Google Functions IBM Function
Runtime Language Node.js, Python, Java, C#, Go Node.js, Java, C#, F# Node.js, Python, Java, C#, Go, PHP, Ruby Nale.js, Python, Java, C#, Go, Swift, PHP
Trigger 21 triggers (Amazon S3, Amazon DynamoDB, Amazon Kinesis Data Streams, Amazon Simple Notification Service, Amazon Simple Email Service, Amazon Simple Queue Service, Amazon Cognito, AWS CloudFormation, Amazon CloudWatch Logs, …) [44] 10 triggers (Azure Cosmos DB, Azure Event Hubs, Azure Event Grid, Azure Mobile Apps (tables), Azure Notification Hubs, Azure Service Bus (queues and topics), Azure Storage (blob, queues, and tables), GitHub(webhooks), On-premises (using Service Bus), Twilio (SMS messages)) [45] 5 triggers (HTTP, Cloud Storage, Cloud Pub/Sub, Firebase (DB, Storage, Analytics, Auth), Stackdriver Logging) [46] 5 triggers (Github, Cloudant, IBM Message Hub, Mobile Push, Periodic Alarm) [47]
Price per Memory $0.0000166/GB-s $0.000016/GB-s $0.00000125/GB-s $0.000017/GB-s
Price per Execution $0.2 per 1M $0.2 per 1M $0.4 per 1M n/a
Free Tier request 1 Mio/Month 1 Mio/Month 2 Mio/Month Free
Maximum Memory 3008MB 1536MB 2048MB 512MB
Container OS Linux Windows NT Debian GNU/Linux 8 (jessie) Alpine Linux
Container CPU Info 2900.05 MHz,1 core 1.4GHZ 2200 MHz, 2 Processor 4 CPU cores,2100.070 MHz
Temp directory 512 MB (/tmp) 500 MB (D:\ Local \ Temp) (/tmp) (/tmp)
Execution Timeout 5 minutes 10 minutes 9 minutes 9 minutes & 5 minutes
Code size limit 50 / 250 MB (compressed/uncompressed) n/a 00MB (compressed) for sources. 500MB (uncompresourcessed) for sources plus modules 48 MB
Concurrent executions 1000/region 1000/region No limit 1000
Logging Stackdriver CloudWatch, X-Ray Services monitoring Functions monitoring
Integration [48] AWS Services(Through AWS SDK) Azure Cosmos DB, Azure Event Hubs, Azure Mobile Apps (tables),Azure Notification Hubs, Azure Service Bus (queues and topics), Azure Storage(blob, queues and tables), Github(webhooks), On-premises(using service bus), Twilio(SMS Messages) Google Cloud Storage, Google Cloud BigTable, Google Cloud Spanner, Google Cloud Datastore, Google Cloud ML Engine, Google Cloud Natural Language API, Google Cloud Speech API, Google Cloud Translation API, Google Cloud Vision API, Google Cloud BigQuery, Google Cloud Pub/sub, Google Stackdriver Logging, Google Firebase IBM Cloudant, IBM Message Hub, IBM Bluemix push notifications, IBM Watson translator, IBM Watson Speech to Text, IBM Watson Text to Speech, Weather Company Data, Slack, GitHub, Websockets, Serverless Framework


Table III: Comparison of serverless Platforms, AWS Lambda, Azure, GC, and IBM Functions

Hence, the prices for serverless computing will sink over time, the real price for serverless computing can be calculated here.

Function throughput indicates the number of concurrent processing of a function instance. The throughput [40] of concurrent invocation of the FaaS from 500 to 10000 for each of these providers is evaluated and shown in Figure 8. It shows that AWS can quickly reach its maximum throughput which is about 400 throughputs per second whereas others reach about 150. Also, IBM OpenWhisk and Microsoft Azure have similar behavior in reaching the best throughput in 2000. On the other hand, the throughput behavior of Google Cloud is linear and indicates a slow and steady increase in throughput.

Fig. 8: Evaluation of Throughput of each providers [40]

Conclusion

The constant reduction of the price of serverless computing and integrating different programming languages in order to increase the functionality and performance by providers motivates companies to migrate from traditional 3-tier architecture to serverless architecture. Also, serverless toolkits are trying to make the development and deployment process of serverless functions cheaper and easier for a user by providing CLIs and local test environment.

Last post: Serverless Computing I

Add a Comment

Your email address will not be published. Required fields are marked *