Do you need to quickly create applications and websites using a fully managed platform? Or maybe you want to run frontend and backend services, batch jobs, or queue workloads, but don’t have to manage the infrastructure? With Cloud Run all of this is possible. What is Cloud Run and what benefits can you gain from implementing it?
What is Cloud Run?
Cloud Run is one of the serverless services available in Google Cloud, which allows you to create an app using containers. As is often the case in a container environment, one of the many benefits is the lack of pre-defined programming languages. You have quite a lot of freedom here.
You can set up your containers as stand-alone web services, APIs, or call them in response to a specific event. Another option is to use the cloud-specific scaling option, both up and down, which means that applications with higher traffic will cope with requests, and with negligible traffic, they will not generate additional costs.
Cloud Run, in addition to creating an app or a website, is ideal for the so-called lightweight data transformation or task planning or workflows using webhooks.
Any language, library or binary
When writing code, you don’t have to worry about any special restrictions. As mentioned in the introduction, you can write code using your favorite programming language, framework or library or libraries, and pack the whole thing into a container and run gcloud run deploy. This will ensure that your app will not only work, but will also be equipped with everything needed to function smoothly in a production environment.
For languages such as Go, Node.js, Python, Java, .NET Core, and Ruby, you can also use the source-based deployment option. In this case, the container will be built for you, using best practices for your language.
Fast autoscaling
Automatic scaling up and down, from zero, means you only pay when your code is running. This works for both container deployments and so-called services. long running.
Automatically create container images from source
Thanks to Cloud Run, an automated transition to the production environment is possible. This is possible by using build packages that enable deployment directly from source without the need to install Docker. Cloud Run allows you to easily build a container image and copy it to the container registry.
So it is possible to automate the build and deploy your code every time new commits are pushed to the Git repository. Here is detailed Google documentation on building containers.
Running scheduled tasks
Cloud Run jobs enable batch processing with instances running in parallel. You can perform run-to-completion tasks that do not respond to HTTP requests.
Direct VPC connectivity
You can redirect traffic directly to the VPC network, i.e. a virtual private cloud hosted within Google Cloud, and thus connect to all services running in the VPC.
Google Cloud Admin API
Cloud Run is often used to create websites and apps. Another application is building REST APIs or GraphQL APIs as well as private microservices communicating via HTTP or gRCP.
Cloud Run services can receive messages from Pub/Sub push subscriptions and EventArc events. They are also helpful in batch processing of data.
Thanks to them, you can run scripts, cron jobs and tasks related to parallel data processing. Cloud Run is therefore suitable for both time-sensitive and long-term tasks.
BBC example
I think there is no need to introduce the BBC, one of the key news media in the UK. BBC websites provide information and entertainment to almost half a billion people around the world. Various sudden events, such as the death of Queen Elizabeth II, cause huge traffic spikes.
By moving to Google Cloud, BBC used not only the capabilities of Cloud Storage, EventArc and BigQuery, but also Cloud Run to provide a reliable and stable service without worrying about scaling during peak hours or emergencies. This allows you to keep up with traffic on the one hand and reduce costs on the other.
Handling traffic spikes
The moment Queen Elizabeth II’s death was announced, traffic increased so much that in just one minute the BBC automatically went from running 150-200 container instances to over 1,000.
It turned out that using Cloud Run was a much more cost-effective solution than running as many virtual machines as needed to help the system survive traffic spikes. Cloud Run has also saved time as once it is launched, there is no longer the need to manage and monitor virtual machine scaling. Cloud Run is therefore the choice for those who want a well-scalable, automatic system that does not require manual intervention.
Isn’t the BBC too abstract an example? Will Cloud Run be useful for smaller organizations? Of course. After all, even a small amount of traffic can increase several times in a very short time, and although it will not reach even a fraction of the value generated by the BBC, it may turn out to be prohibitively high for you, as the owner or person managing the website or application.
Find out more about Cloud Run
If you want to learn how to configure Cloud Run, I recommend contacting FOTC experts. They will show you step by step how to run and adapt this solution to the needs of your application or website. They will also help you select the right Cloud services for your project and calculate the costs so that you make an informed choice about Cloud Run.