Google Cloud Run is one of the new cloud computing platform which was developed by Google on April 2019. Before knowing about Google Cloud Run, we need to know what serverless computing is. Serverless computing is a method where the users do not have to rent or purchase servers to run their applications or programs. Even though they are named “serverless”, they run based on server, but we are not responsible for them. For the last 10 years, cloud computing has slowly gained popularity.
Serverless computing is classified into two types:
- BaaS (Backend as a Service): This type outsources application to the cloud providers. They are mainly used for database management, user authentication, storage and notifications for mobile applications.
- FaaS (Function as a Service): They function using the codes. This particular code is only used as a response to certain events and requests. It divides monolithic servers into different functionalities. This makes scalability and availability easier.
Container is a set of applications which does not require an operating system. This makes them lightweight, user friendly and portable. They are usually combined with software’s source code along with its settings. The process of creating a container is called “Image”. Image is basically an unexchangeable file which is used to create a container and run the code within them. The major aim of container is to create a suitable environment for the application to function when the software is transferred to any other system.
Google Cloud Run
Google Cloud Run is a specialized platform which brings Serverless to containers. They can efficiently run Docker container images in the form of HTTP service. Every container can be converted into HTTP request. Users are relieved from the works like scaling, configuration and management.
Google Cloud Run has Knative platform as base. Knative platform is generally an API which is mainly used for creating, functioning and managing serverless workloads. They performance is based on Kubernetes which is another platform that facilitates serverless computing.
- Simple Autoscaling process: Based on the type of traffic present, Google Cloud Run can auto-scale your application up or down.
- Fully managed: As it is a serverless computing system, Google Cloud Run manages all the complicated parts of the IT infrastructure.
- Fully flexible: Cloud Run is compatible with the codes created using Python, PHP, Pascal and Perl.
- Cost-efficient: You need to pay only when your function are executed. Subscription begins when Functioning starts and till the end of the program.
You can run Google Cloud Run in two different situations; while you have a fully managed environment or by using Google Kubernetes Engine. You have the freedom to switch between these two conditions without reimporting your service.
In order to execute Google Cloud Run, the developers have created a container runtime contract which narrates about certain behaviour of the applications. They include:
- Code should be created using a standard programming language (Python, Java etc.) or using base image.
- The container must be compatible for Linux 64-bit, but it can be used with any programing language or base image.
- The container should be efficient enough to receive HTTP request on the IP address which is listed in the PORT environment variable.
- The container should be efficient enough to start the server immediately after receiving the HTTP request.
- The container file should be a writable. The data written on the file will not remain once the container has stopped.
When you use Google Cloud Run, the container will have permission only to access CPU resources when the request is not processed. Unless for processing requests, the container cannot have your CPU details. While using Cloud Run, container should not depend on any state of service as the functioning may get interrupted.
The resources required for container in Google Cloud Run are:
- CPU: Cloud Run needs virtual CPU to function. Using this, the program can run on multiple cores at the same time.
- Memory: Each container used in Cloud Run has a memory space of 256 MB. As per the new update, it can be increased to 2GB.
Google Cloud Run is the suitable platform for those who are aiming at serverless computing and container technologies in their application.