buchachon - Fotolia
Serverless computing continues to rise in popularity and the cloud giants continue to lead the way with compute services and tools that fit this approach to building apps.
Choosing the right serverless service was once simpler, since each provider had only one offering. However, as AWS, Microsoft, Google and others expand their serverless offerings, not only must you decide what provider to use, but also which service to use within that specific provider.
Below, we will take a look at the three Google Cloud serverless offerings: Cloud Run, Cloud Functions and App Engine, as well as a quick peek at Google Kubernetes Engine (GKE) Autopilot.
Google Cloud Run
Google Cloud Run deploys containerized applications on top of a fully managed serverless platform.
With Cloud Run, developers can use their preferred programming language, such as Go, Python, Node, Java and Ruby, as well as any language or OS libraries. The learning curve for Cloud Run is relatively modest, and odds are good that an IT team can ramp up development with the service rather quickly.
This Google Cloud serverless service integrates with other tools in the container ecosystem, including:
- Google Cloud Build to enable CI/CD;
- Google Cloud Code for writing and debugging;
- Google's Artifact Registry for package and image management; and
Also, it runs on Knative, an open source project for deploying, running and managing Kubernetes cloud applications. Knative increases portability across platforms and mitigates vendor lock-in since these technologies aren't Google Cloud specific.
What is Google Cloud Run ideal for?
Cloud Run is best for IT teams that want to use containers, as well as take advantage of serverless benefits. Also, this service can be more cost-effective since it is pay-per-use and includes a free tier, which rounds up to the nearest 100 milliseconds.
Some common Cloud Run use cases include:
- websites and web applications;
- REST API back ends;
- back‐office administration;
- data processing and transformation; and
- automation and workflow optimization with webhooks.
Google Cloud Functions
With Google Cloud Functions, developers write their code and Google does the rest. This means developers can create functions without having to worry about the underlying cloud infrastructure. The service also works with HTTP requests or in response to background events. Deployment depends on proper packaging.
For languages, developers can write HTTP and event-driven functions in Node.js, Python, Go, Java, .NET and Ruby. Then, the function executes in its language-specific runtime.
If you need containerized runtimes, use Cloud Run instead. Cloud Functions is lightweight by comparison, but this stripped-down service still recognizes that code forms the backbone of the user experience.
What is Google Cloud Functions ideal for?
Serverless is often popular for those who want to save money on cloud. An enterprise is only charged for how long a function runs, how many times it's invoked and how many resources are provisioned for it. Similar to Cloud Run, Cloud Functions offers a free tier with 2 million free invocations per month. After that, it is $0.40 per million.
Some popular Cloud Functions use cases include:
- third-party service and API integrations;
- IoT and mobile back ends;
- real-time processing;
- video, image and sentiment analysis; and
- virtual assistants and automated chats.
To understand the birth of serverless technologies, we must first acknowledge their predecessors.
Modern, containerized applications rely on server-backed instances. While this system is flexible and highly configurable, it requires ongoing maintenance. Teams also have floor costs to consider, since idle servers still cost money; hardware infrastructure is expensive.
Conversely, serverless providers maintain the servers, including software and security updates. Your vendor automatically handles resource provisioning in the background, according to application-specific demands.
Traditional platforms require forward-thinking design scalability. Serverless deployments, relatively speaking, don't require extensive pre-launch planning. Given that your code and memory usage are optimized, serverless offerings can provide excellent performance.
Let's not forget pricing. Serverless options are pay-as-you-go, meaning you only pay for consumed resources. Serverless relies on functional code execution, which means you do not pay for idle time. This can significantly cut costs compared to other compute models. This makes serverless perfect for small companies -- or those looking to consolidate.
Google App Engine
Google App Engine is a fully managed serverless platform that works with any language runtime. It caters to specific use cases -- primarily building web applications and scalable, mobile back ends. For example, apps like YouTube and Snapchat were made using App Engine. Even IT apps and front-end workloads pair well with this service.
While some features overlap with Google Cloud Functions, App Engine remains more tech stack inclusive, with an emphasis on deploying apps quickly. It has native tools for testing, launching and updating applications. And because applications rely on data storage, this serverless service supports both NoSQL and Google Cloud SQL.
Additionally, App Engine includes numerous APIs. These APIs support functions such as logging, Blobstore, Cloud Storage, SSL and Cloud Endpoint. The service also scales in lockstep with your user base. It remains the most streamlined service in Google's serverless portfolio.
Honorable mention: GKE Autopilot
Introduced in February 2021, GKE Autopilot brings more serverless functionality to Google Cloud. Google refers to this service as a new mode of operation that decreases the operational costs of managing clusters.
It is a good fit for Kubernetes developers who want to buck the responsibility of managing underlying infrastructure. Instead, Google's site reliability engineers shoulder the burden.
GKE Autopilot pricing operates on a pay-as-you-go model, which mirrors Google's other serverless options. As Autopilot matures, its serverless foundation will continue to entice developers.
Dig Deeper on Cloud architecture design and planning
Related Q&A from Adam Bertram
The quest to keep up with constant changes to software is tough for IT admins, but they can make their lives easier by automating the deployment ... Continue Reading