- Status: approved
- Last Updated: 2021-04
- Builds on: Prefer Serverless, Python Default
- Objective: Choose a hosting platform for the website/UI application.
We are building a website/webapp as the user interface of the Giving app. It will be built in Python, based the previous decision to default to Python as the common application development language on the team.
Where should we run a human-facing website written in Python?
- Websites should be snappy
- We will have various web assets to serve
- Option 1: Cloud Run
- Option 2: App Engine (Standard)
- Option 3: Cloud Functions
- Option 4: Firebase Hosting + Cloud Functions
Chosen option [Option 1: Cloud Run]
We discarded [Option 3: Cloud Functions] right away: it's not a good fit for general web serving.
We discarded [Option 4: Firebase Hosting + Cloud Functions] almost as quickly. While that model would work, we're starting with an approach of dynamically generating a lot of the HTML markup with Python, this might work in the future but not during MVP.
This left us with Cloud Run or App Engine.
The page App Hosting on Google Cloud suggests that backend apps in Flask or Django should use Cloud Run.
It further points out that Cloud Run (and not App Engine) enables Custom system packages, WebSockets, managed events-driven architectures, and running languages beyond the 7 supported on App Engine. This provides more flexibility to evolve the tech stack later.
Looking closer (and looking ahead to rollout/rollback plans), Cloud Run's traffic management features look really powerful.
App Engine's been around longer, so there may be more content and guidance available.
Google Search:
how to build an app on "App Engine"
has 170,000 published since 2016how to build an app on "Cloud Run"
has 51,000 results published since 2016