Chapter 4. Serverless Platform Quick Reference Guide
Here’s a short summary of the three platforms mentioned in this report (Amazon, Microsoft, and Google), taking into account the seven features discussed in Chapter 3. You can use this as a handy reference guide when looking at each platform, and to remember your priorities when deciding on which fits your current needs.
I encourage readers to spend time on all three of these platforms before making a final judgment. It is possible that, after working with a platform that seems to be a good fit, you’ll determine that one of the other offerings will better fit your needs at the moment.
Amazon Lambda
Since AWS is currently the leader in the serverless space, it’s useful to spend time learning how it all works and determining whether AWS is the best fit for you.
Navigating the maze of setup and configuration details can be a bit daunting at first. However, the good news is that this investment pays off. The initial examples may be a bit hard to follow, since not everything is explained right away, but it all falls into place once you work through some of the provided tutorials.
- Home Page
- Supported Languages
-
Amazon Lambda supports Java, Go, Node.js, C#, Python, and Ruby. There is also a Runtime API that allows you to use additional programming languages to code Lambda functions.
- Account Setup and Configuration
-
Setup is a bit involved. You need to first have an AWS login account to manage your services. Then you need to set up at least one AWS identity and access management (IAM) account to use a running instance of AWS functions. IAM accounts are associated with two important elements: your AWS access key ID and your AWS secret access key. You’ll need both of them when you want to access your running serverless function. When creating functions you’ll need to select a Region where they will run (e.g., US-West).
- Runtime Security Options
-
You can use the AWS IAM system to set up access control lists based on roles and associate these roles with AWS profiles.
- API Routing Control
-
You can use AWS’s API Gateway to set up routing controls for your Lambda functions.
- Workflow and Orchestration
-
You can use AWS Step Functions to configure and manage workflow orchestrations for your serverless functions.
- Scaling and Reliability
-
AWS offers a range of services to handle auto-scaling for your serverless instances. There are some nuances on how auto-scaling works for Lambda functions including how to handle synchronous versus asynchronous implementations and how it all integrates with AWS metrics.
- Metrics and Monitoring
-
Metrics and monitoring is handled by Amazon’s CloudWatch product. For serverless cases, there are additional details to help manage Lambda metrics.
Microsoft Azure Functions
I found getting started with Microsoft’s Azure platform relatively easy. This is especially true if you already use Microsoft Visual Studio and relating tooling.
Most of the important aspects of Azure Functions can be handled from its online user interfaces, and there is quite a bit of code-level access for those who need that. I did find it a bit frustrating to work through so many choices at each step along the way (routing, workflow, scaling, etc.) but, in the end, the choices can help you better tune your serverless implementations.
- Home Page
- Supported Languages
-
As of this writing, Azure Functions supports the following programming languages: C#, JavaScript, F#, and Java. The following are listed as “experimental”: PowerShell, Python, TypeScript, PHP, and bash. Language support will depend on which version of the Azure Functions runtime you are using.
- Account Setup and Configuration
-
You’ll need an Azure account to log in. You also need to declare an Azure app project as the internal code management unit. When you’re ready to deploy, you’ll need to declare a resource group (used to group projects) and select a runtime region for that resource group. Finally, you’ll need to create a function project (not an app project) in order to deploy your function to the assigned region. You can check out this CLI-based tutorial to get a walk through all this configuration work.
- Runtime Security Options
-
Microsoft offers several security models for your Azure Functions implementations. You can apply SSL certificates, use Microsoft’s Active Directory, or use OAuth providers such as Facebook, Google, Microsoft, and Twitter. Microsoft also has tutorials on how to apply role-based access control to your serverless apps.
See the whitepaper “Azure Functions and serverless platform security” for some details.
- API Routing Control
-
Azure’s API routing is handled by its API Management product. It supports a wide range of rules and restrictions that you can apply along with integration with security features. You need to create an instance of the API Management services, set up, and configure the gateway; you can use OpenAPI documents to get started. Then tweak the routing and monitoring details to fit your needs. You can also use Microsoft’s PowerShell to manage and update your gateway.
Check out this quick start-up guide.
- Workflow and Orchestration
-
Microsoft takes a layered approach to serverless workflow. First, it has a code-level option called Durable Functions, which is a code-only library for developers. Next, Logic Apps can be used via designer tools or code. Finally, there is Microsoft’s Power Automate, which is aimed at productivity workers (not developers) as a way to “glue” standalone services together to form a workflow. You can only use Power Automate through the online designer; there is no code library. Determining which is best for your use case depends on your target audience and the types of services you want to use in your orchestration.
- Scaling and Reliability
-
The Azure platform offers a set of hosting plans and each has a slightly different approach to resilience and reliability scaling. The Consumption plan is the default and allows you to monitor demand and automatically scale up as needed. The Premium plan adds the ability to tune performance and establish services that will operate on “warm start” and other details. Finally, the Dedicated plan allows you to customize all aspects of your auto-scaling profile.
- Metrics and Monitoring
-
Microsoft offers its Application Insights platform to help you set up and monitor metrics for your Azure functions. Along with the typical metrics of request rates, memory, exceptions, session count, and performance monitoring, you can create custom events to monitor application-level values such as “completed shopping checkout.”
Google Cloud Functions
Cloud Functions is the name of Google’s serverless product. It is one part of the overall Google Cloud Platform (GCP). If your organization is already using Google Cloud Platform products and services, adopting Cloud Functions for your serverless needs may make sense.
Google’s offering is extensive and deep. However, I had a hard time finding features and functions I was looking for, and in some cases those features were difficult to set up and/or understand how to use. Some parts of the platform seem to conflict with other parts (e.g., Cloud Endpoints versus Apigee’s API Management), and others are based on external open source projects (e.g., Apache Airflow). Finally, GCP offers the smallest collection of language support, which may be an issue for your organization.
- Home Page
- Supported Languages
-
Google Cloud Functions currently supports Node.js, Python, and Go.
- Account Setup and Configuration
-
You’ll need a Google Cloud Platform (GCP) account to get started. Once you can log in, you’ll be able to turn on the Cloud Functions API for your account. This allows you to build and deploy your functions. You’ll need to configure your region value to tell GCP where your deployments will run.
- Runtime Security Options
-
Google has its own IAM platform for fine-grained access control. You use Google’s Cloud IAM to control who can edit the source code, who can access the running functions, and how functions can access each other. Google has a preset collection of IAM roles. Implementing access control is done through OAuth.
- API Routing Control
-
Google offers a rich collection of API management functionality including routing rules, a developer portal, and much more. This functionality comes via the Apigee platform Google acquired in 2016. The heart of the product is its API management platform, Apigee Edge product. Google also offers the Cloud Endpoints platform. This is a completely separate product dedicated to supporting the Google Cloud backend.
- Workflow and Orchestration
-
Google’s workflow offering is called Cloud Composer and is based on Apache Airflow. You need to enable Google’s Cloud Composer API in order to use it with your functions. Finally, you will need to learn to program using Airflow’s directed acyclic graphs in the Python programming language. There is a quick start guide along with several tutorials.
- Scaling and Reliability
-
Google offers access to controlling quota settings for your serverless functions. There are more than a dozen metrics you can use to tune how Google scales your functions up or down as needed. You also can directly control how your serverless functions respond to traffic demands with the Controlling Scaling Behavior tool.
- Metrics and Monitoring
-
Google’s monitoring product is Stackdriver Monitoring. You can access controls for your GCP functions to see logs, error reports, and other metrics. There is also an option to turn on audit logging.
Get What Is Serverless? now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.