Serverless App Deployment Using GCP Cloud Run and Flask
If you want to deploy an API/App on GCP - Google Cloud Platform, there are various options:
- Google App Engine
- Google Kubernetes Engine (GKE)
- Google Compute Engine (GCE)
- Cloud Functions
- Cloud Run
- Anthos
Among these options, Cloud Function and Cloud Run both are serverless compute platform.
What's serverless?
When to Use Cloud Functions and When to Use Cloud Run?
Use Cloud Functions when:
- You need to run simple functions whose execution time is short (usually around 9 minutes) in response to events, such as processing data or sending notifications.
- You want a platform that automatically scales to handle many events.
- You want a platform that's simple to use and requires a very little setup.
Use Cloud Run when:
- You need to run more complex applications, such as web apps or APIs.
- You want more control over the environment, such as specifying how much CPU and memory to use.
- You want to deploy entire applications as containers, rather than just small functions.
- You are willing to wait a little longer for the application to start up in exchange for more control over the environment.