Heads up IT professionals! Google Cloud Run is a new cloud computing platform and it is out of Beta that’s hot off the presses from Google, First announced at the company’s Google Cloud Next conference, April 2019 marked its remarkable birth. Google Cloud Run has generated a lot of excitement (and a lot of questions) among both tech journalists and users of the public cloud alike even though it’s still in beta.
After today, you will understand the ins and outs of Google Cloud Run. In this all in one guide, we will uncover the features packed inside Google Cloud Run, the appeal of Google Cloud to customers worldwide, and a few comparisons to the alternatives to Google Cloud Run.
Table of Contents
Need A Google Cloud Run Alternative?
Find out why Google Cloud Run users are switching to IronWorker.
What is Serverless Computing?
To answer the question above "What is Google Cloud Run?" we first need to define serverless computing. Often just called "serverless," serverless computing is a cloud computing paradigm that frees the user from the responsibility of purchasing or renting servers to run their applications on.
Straightforwardly called “serverless,” The code still runs on a server, just not one that the user has to worry about.
Cloud computing has soared in popularity over the past decade. This is thanks in large part to the increased convenience and lower maintenance requirements. Traditionally, however, users of cloud services have still needed to set up a server, scale its resources when necessary, and shut it down when you're done. This has all changed with the arrival of serverless.
The phrase "serverless computing" is applied to two different types of cloud computing models:
- BaaS (backend as a service) outsources the application backend to the cloud provider. The backend is the "behind the scenes" part of the software for purposes such as database management, user authentication, cloud storage, and push notifications for mobile apps.
- FaaS (function as a service) still requires developers to write code for the backend. The difference is this code is only executed in response to certain events or requests. This enables you to decompose a monolithic server into a set of independent functionalities, making availability and scalability much easier.
You can think of FaaS serverless computing as like a water faucet in your home. When you want to take a bath or wash the dishes, you simply turn the handle to make it start flowing. The water is virtually infinite, and you stop when you have as much as you need, only paying for the resources that you've used.
Cloud computing without FaaS, by contrast, is like having a water well in your backyard. You need to take the time to dig the well and build the structure, and you only have a finite amount of water at your disposal. In the event that you run out, you'll need to dig a deeper well (just like you need to scale the server that your application runs on).
Regardless of whether you use BaaS or FaaS, serverless offerings allow you to write code without having to worry about how to manage or scale the underlying infrastructure. For this reason, serverless has come into vogue recently. In a 2018 study, 46 percent of IT decision-makers reported that they use and evaluate serverless.
What Are Containers?
Now that we've defined serverless computing, we also need to define the concept of a container. Containers do not include the underlying operating system. This makes them more lightweight, portable, and easy to use. (Feel free to skip to the next section if you're very comfortable with your knowledge of containers.)
In the world of computing, a container is an application "package" that bundles up the software's source code together with its settings and dependencies (libraries, frameworks, etc.). The "recipe" for building a container is known as the image. An image is a static file that is used to produce a container and execute the code within it.
One of the primary purposes of containers is to provide a familiar IT environment for the application to run in when the software is moved to a different system or virtual machine (VM).
Containers are part of a broader concept known as virtualization, which seeks to create a virtual resource (e.g., a server or desktop computer) that is completely separate from the underlying hardware.
Unlike servers or machine virtualizations, containers do not include the underlying operating system. This makes them more lightweight, portable, and easy to use.
When you say the word "container," most enterprise IT staff will immediately think of one, or both, of Docker and Kubernetes. These are the two most popular container solutions.
- Docker is a runtime environment that seeks to automate the deployment of containers.
- Kubernetes is a "container orchestration system" for Docker and other container tools, which means that it manages concerns such as deployment, scaling, and networking for applications running in containers.
Like serverless, containers have dramatically risen in popularity among users of cloud computing in just the past few years. A 2018 survey found that 47 percent of IT leaders were planning to deploy containers in a production environment, while 12 percent already had. Containers enjoy numerous benefits: platform independence, speed of deployment, resource efficiency, and more.
Containers vs Serverless: A False Dilemma
Given the massive success stories of containers and serverless computing, it's hardly a surprise that Google would look to combine them. The two technologies were often seen as competing alternatives before the arrival of Google Cloud Run.
Both serverless and containers are intended to make the development process less complex. They do this by automating much of the busy work and overhead. But they go about it in different ways. Serverless computing makes it easier to iterate and release new application versions, while containers ensure that the application will run in a single standardized IT environment.
Yet nothing prevents cloud computing users from combining both of these concepts within a single application. For example, an application could use a hybrid architecture, where containers can pick up the slack if a certain function requires more memory than the serverless vendors has provisioned for it.
As another example, you could build a large, complex application that mainly has a container-based architecture, but that hands over responsibility for some backend tasks (like data transfers and backups) to serverless functions.
Rather than continuing to enforce this false dichotomy, Google realized that serverless and containers could complement one another, each compensating for the other one's deficiencies. There's no need for users to choose between the portability of containers and the scalability of serverless computing.
Enter Google Cloud Run…
What is Google Cloud Run?
In its own words, Google Cloud Run "brings serverless to containers." Google Cloud Run is a fully managed platform that is capable of running Docker container images as a stateless HTTP service.
Each container can be invoked with an HTTP request. All the tasks of infrastructure management--provisioning, scaling up and down, configuration, and management--are cleared away from the user (as typically occurs with serverless computing).
Google Cloud Run is built on the Knative platform, which is an open API and runtime environment for building, deploying, and managing serverless workloads. Knative is based on Kubernetes, extending the platform in order to facilitate its use with serverless computing.
In the next section, we'll have more technical details about the features and requirements of Google Cloud Run.
IronWorker > Google Cloud Run
Speak to us to learn how IronWorker is the better alternative to Goolge Cloud Run to deploy your application.
Google Cloud Run Features and Requirements
Google cites the selling points below as the most appealing features of Google Cloud Run:
- Easy Autoscaling: Depending on light or heavy traffic, Google Cloud Run can automatically scale your application up or down.
- Fully Managed: As a serverless offering, Google Cloud Run handles all the annoying and frustrating parts of managing your IT infrastructure.
- Completely Flexible: Whether you prefer to code in Python, PHP, Pascal, or Perl, Google Cloud Run is capable of working with any programming language and libraries (thanks to its use of containers).
- Simple Pricing: You pay only when your functions are running. The clock starts when the function is spun up, and ends immediately once it's finished executing.
There are actually two options when using Google Cloud Run: a fully managed environment or a Google Kubernetes Engine (GKE) cluster. You can switch between the two choices easily, without having to reimplement your service.
In most cases, it's best to stick with Google Cloud Run itself, and then move to Cloud Run on GKE if you need certain GKE-specific features, such as custom networking or GPUs. However, note that when you're using Cloud Run on GKE, the autoscaling is limited by the capacity of your GKE cluster.
Google Cloud Run Requirements
Google has already released a container runtime contract describing the behavior that your application must adhere to in order to use Google Cloud Run.
Some of the most noteworthy application requirements for Google Cloud Run are:
- Code in Your favorite programming language or base image. (Go, Python, Java, Ruby, Node.js, and more).
- The container must be compiled for Linux 64-bit, but it can use any programming language or base image of your choice.
- The container must listen for HTTP requests on the IP address 0.0.0.0, on the port defined by the PORT environment variable (almost always 8080).
- The container instance must start an HTTP server within 4 minutes of receiving the HTTP request.
- The container's file system is an in-memory, writable file system. Any data written to the file system will not persist after the container has stopped.
With Google Cloud Run, the container only has access to CPU resources if it is processing a request. Outside of the scope of a request, the container will not have any CPU available.
In addition, the container must be stateless. This means that the container cannot rely on the state of a service between different HTTP requests, because it may be started and stopped at any time.
The resources allocated for each container instance in Google Cloud Run are as follows:
- CPU: 1 vCPU (virtual CPU) for each container instance. However, the instance may run on multiple cores at the same time.
- Memory: By default, each container instance has 256 MB of memory. Google says this can be increased up to a maximum of 2 GB.
Google Cloud Run Pricing
Google Cloud Run users are only charged for the resources they use. (rounded up to the nearest 0.1 seconds). Since Google Cloud Run uses a "freemium" pricing model: free monthly quotas are available, but you'll need to pay once you go over the limit. These types of plans frequently catch users off guard. They end up paying much more than expected. According to Forrester, a staggering 58% of companies surveyed said their costs exceeded their estimates.
The good news for Google Cloud Run users is that you're charged only for the resources you use (rounded up to the nearest 0.1 second). This is typical of many public cloud offerings.
The free monthly quotas for Google Cloud Run are as follows:
- CPU: The first 180,000 vCPU-seconds
- Memory: The first 360,000 GB-seconds
- Requests: The first 2 million requests
- Networking: The first 1 GB egress traffic (platform-wide)
Once you bypass these limits, however, you'll need to pay for your usage. The costs for the paid tier of Google Cloud Run are:
- CPU: $0.000024 per vCPU-second
- Memory: $0.0000025 per GB-second
- Requests: $0.40 per 1 million requests
- Networking: Free during the Google Cloud Run beta, with Google Compute Engine networking prices taking effect once the beta is over.
It's worthwhile to note you are billed separately for each resource; for example, the fact that you've exceeded your memory quota does not mean that you need to pay for your CPU and networking usage as well.
In addition, these prices may not be definitive. Like the features of Google Cloud Run, prices for Google Cloud are subject to change once the platform leaves beta status.
Lastly, Cloud Run on GKE uses a separate pricing model. GKE charges a cluster management fee of $0.10 per cluster per hour.
Google Cloud Run Review: Pros and Cons
Reaction to Google's announcement has been fairly positive, acknowledging the benefits of combining serverless computing with a container-based architecture. Some users believe that the reasonable prices will be enough for them to consider switching from similar services such as AWS Fargate.
Some are worried about making the switch, given Google's track record of terminating services such as Google Reader, as well as their decision to alter prices for the Google Maps API, which effectively shut down many websites that could not afford the higher fees.
The disadvantages of Google Cloud Run will likely overlap with the disadvantages of Google Cloud Platform as a whole. These include the lack of regions when compared with competitors such as Amazon and Microsoft. In addition, as a later entrant to the public cloud market, Google can sometimes feel "rough around the edges," and new features and improvements can take their time to be released.
Google Cloud Run Alternatives
Since this is a comprehensive review of Google Cloud Run, we would be remiss if we didn't mention some of the available alternatives to the Google Cloud Run service.
In fact, Google Cloud Run shares some of its core infrastructure with two of Google's other serverless offerings: Google Cloud Functions and Google App Engine.
- Google Cloud Functions is an "event-driven, serverless compute platform" that uses the FaaS model. Functions are triggered to execute by a specified external event from your cloud infrastructure and services. As with other serverless computing solutions, Google Cloud Functions removes the need to provision servers or scale resources up and down.
- Google App Engine enables developers to "build highly scalable applications on a fully managed serverless platform." The service provides access to Google's hosting and tier 1 internet service. However, one limitation of Google App Engine is that the code must be written in Java or Python, as well as use Google's NoSQL database BigTable.
Looking beyond the Google ecosystem, there are other strong options for developers who want to leverage both serverless and containers in their applications.
The Most Tested Cloud Run Alternative: Iron.io
Iron.io is a serverless platform that offers a multi-cloud, Docker-based job processing service. As one of the early adopters of containers, we have been a major proponent of the benefits of both technologies.
The centerpiece of Iron.io's products, IronWorker is a scalable task queue platform for running containers at scale. IronWorker has a variety of deployment options. Anything from using shared infrastructure to running the platform on your in-house IT environment is possible. Jobs can be scheduled to run at a certain date or time, or processed on-demand in response to certain events.
In addition to IronWorker, we also provide IronFunctions, an open-source serverless microservices platform that uses the FaaS model. IronFunctions is a cloud-agnostic offering that can work with any public, private, or hybrid cloud environment, unlike services such as AWS Lambda. Indeed, Iron.io allows AWS Lambda users to easily export their functions into IronFunctions. This helps to avoid the issue of vendor lock-in. IronFunctions uses Docker containers as the basic unit of work. That means that you can work with any programming language or library that fits your needs.
Google Cloud Run represents a major development for many customers of Google Cloud Platform who want to use both serverless and container technologies in their applications. However, Google Cloud Run is only the latest entrant into this space, and may not necessarily be the best choice for your company's needs and objectives.
Switch From Google Cloud Run To IronWorker
If you want to determine which serverless + container solution is right for you, speak with a skilled, knowledgeable technology partner like Iron.io who can understand your individual situation. Whether it's our own IronWorker solution, Google Cloud Run, or something else entirely, we'll help you get started on the right path for your business.