I run a number of small websites on AppEngine. Mostly static files, occasionally a little bit of code.
I constantly hear that Cloud Run is superior to AppEngine... is it for my use case?
I don't think cloud run has a nice way to serve the static files, is that correct?
When to use Google App Engine Flex vs Google Cloud Run - Stack Overflow
App Engine Standard vs Cloud Run trade offs - Stack Overflow
node.js - Building a Node app should I use App Engine or Google Cloud Run? - Stack Overflow
Are AppEngine/Cloud Run really the much simpler/more stable?
Videos
Pricing/Autoscaling: The pricing model between GAE Flexible Environment and Cloud Run are a bit different.
- In GAE Flexible, you are always running at least 1 instance at any time. So even if your app is not getting any requests, you’re paying for that instance. Billing granularity is 1 minute.
- In Cloud Run, you are only paying when you are processing requests, and the billing granularity is 0.1 second. See here for an explanation of the Cloud Run billing model.
Underlying infrastructure: Since GAE Flexible is running on VMs, it is a bit slower than Cloud Run to deploy a new revision of your app, and scale up. Cloud Run deployments are faster.
Portability: Cloud Run uses the open source Knative API and its container contract. This gives you flexibility and freedom to a greater extent. If you wanted to run the same workload on an infra you manage (such as GKE), you could do it with "Cloud Run on GKE".
I'd actually suggest that you seriously consider Cloud Run over App Engine.
Over time, I've seen a few comments of a "new" App Engine in the works, and it really seems that Cloud Run is that answer. It is in beta, and that can be an issue. I've seen some companies use beta services in production and others wait. However, if I am going to start a new app today - it's going to be Cloud Run over App Engine Flex for sure.
Google is very deep into Kubernetes as a business function. As Cloud Run is sitting on GKE - this means that it is indirectly receiving development via other teams (The general GKE infrastructure).
Conversely, App Engine is on some older tech. Although it's not bad - it is "yesterday's" technology. Google, to me, seems to be a company that gets really excited about what is new and what is being highly adopted in the industry.
All this said - when you wrap your services in a container, you should be able to run them anywhere? Well, anywhere there is a container platform. You can front your services with something like Cloud Endpoints and you can deploy on both App Engine and Cloud Run - swap back and forth. Then, at that point, the limitations might be the services that are offered. For instance, Cloud Run currently doesn't support some items, like Cloud Load Balancing or Cloud Memorystore. That might be a blocker today.
App Engine is a Platform-as-a-Service. It means that you simply deploy your code, and the platform does everything else for you. For example, if your app becomes very successful, App Engine will automatically create more instances to handle the increased volume.
It auto scales from 0 to unlimited instances (It uses GCE underneath). It comes with 2 flavors Standard Environment and Flexible Environment. Standard Environment is really fast, scales down to 0 instances when no-one is using your app, scales up and down in seconds and has dedicated Google services and libraries for caching, authentication etc. The caveat with Standard environment is that it is very restrictive since it runs in a sandbox. The recent additions are Node.js (8.x) and Python 3.x. Flexible Environment is more open as it allows you to use custom runtimes as it uses docker containers. Thus if your runtime is not available in the provided runtimes, you can always create your own dockerfile for the execution environment. The caveat with it is, it requires having at least 1 instance running, even if no-one is using your app, plus the scaling up and down requires a few minutes.
Read more about App Engine
App Engine is for deploying code, Cloud Run for deploying containers, and containers are today’s requirements.Cloud Run runs containers, so for each release you have to build a container and push it to GCP.
Cloud Run, App Engine Flexible and Newer runtimes of App Engine Standard are designed for portability (you can use open-source libraries or standard libraries and not just Google Libraries). Cloud Run and App Engine Flexible allow for custom runtimes.
Cloud Run gives you the freedom to expand your infrastructure into hybrid and multi-cloud environments.
Read more about Cloud Run
Differences you should consider:
For a low-traffic application, Cloud Run or App Engine Standard which is set to automatic scaling are both cheaper than App Engine Standard which is set to manual/basic scaling or App Engine Flexible. Cloud Run only runs when it is serving requests. App Engine which is set to automatic scaling shuts down when it is not serving requests. This means for both types, you're not using resources when your application is not running and Google only bills you for resources that you consume. In addition, App Engine Standard provides a free daily quota of resources so you're only billed for consuming resources above the free quota. App Engine Flexible or App Engine Standard set to manual/basic scaling must have at least 1 instance running continuously, which means they run for a full month which in turn means you're going to pay more.
App Engine responds on average 56 ms faster than Cloud Run. The huge caveat here is that these times vary widely between runs, sometimes tripling or quadrupling The total request size from Cloud Run was larger because it doesn’t gzip files by default. The big difference between the two services is that Cloud Run doesn’t run your container unless it’s getting requests. When a request comes in, it does things: [i] boots up the container [ii] serves the request [iii] shuts down the container Of course, you also save a lot of money doing it this way, so the tradeoff here is whether you care more about optimizing your speed or your cost.
AppEngine can only be deployed to a single region. If you want an AppEngine app to be multi-regional then you need one project per region. Cloud run allows you to deploy a service to every region within a single project making your API truly global, all within a single project
Cloud Run also allows you to set up a static IP address, something you cannot get with AppEngine. This is helpful for situations where you need to relay mail or connect to some other service that restricts access by IP address. Also AppEngine still has some things Cloud Run doesn't (like Identity Aware Proxy) have.
The docker image support in Cloud Run is also more versatile than what you get from AppEngine Standard, and Cloud Run has more robust options to choose from (more ram, cpu, etc).
1https://cloud.google.com/appengine/docs/standard/nodejs/quickstart 2https://cloud.google.com/run/docs/quickstarts/build-and-deploy/deploy-nodejs-service
Google App Engine:
App Engine provides a fully managed platform-as-a-service (PaaS) environment.
It offers automatic scaling, load balancing, and other infrastructure management tasks out of the box.
Google Cloud Run:
Cloud Run is a serverless container platform that runs stateless containers on demand.
It provides a more flexible and customizable environment compared to App Engine.
You can deploy your Django app as a containerized application using Docker.
Cost efficient than App Engine