Deploying Python Application in Google Cloud (GCE, GAE, GKE & Cloud Run) — Part 1
Team: Shekhar Suman, Tanuj Bolisetty & Dharmil Shah
Overview
Why another blog?
Deploying an application in Google Cloud may have been documented umpteenth time on different platforms/websites. However, we thought to ourselves what’s the harm in compiling our own journey, challenges and learnings. End of the day the storyline is — we stumble till we crawl, then we learn to walk, run and eventually fly to where we want to be. So here it starts.
What is included in the blog?
- Migrating on-premises MySQL database to CloudSQL.
- Deploying Python Web application on Compute Engine, App Engine, Kubernetes Engine & Cloud Run.
The approach?
There are 2 approaches that we will be covering in this blog:
- Lift & Shift
- Lift & Leverage
In ‘Lift & Shift’ approach, we will make our application work AS-IS, the way it is working in our on-premises environment. This is a short-term approach for anyone who would like to move their application to Google Cloud and make it up and running in a short span. In ‘Lift & Leverage’ approach, we will make use of the managed services like App Engine, Google Kubernetes Engine & Cloud Run.
Python Application Architecture
The python web application consists of below components:
- MySQL as the backend database.
- Python Flask based web application.
The simplistic architecture diagram is provided below:
We will skip the ‘ETL Engine’ part in this blog, which is bunch of python ETL scripts which extracts data from different data sources, transforms and loads it into the MySQL database. We will focus on deploying the Python Web Application and Angular UI in Google Cloud.
We will go step-by-step, starting with migrating on-premises MySQL database to GCP CloudSQL in the next section.
Link to Other Parts
Part 2: Migrating MySQL to CloudSQL
Part 3: Python Web Application on Compute Engine (GCE)
Part 4: Python Web Application on App Engine (GAE)
Part 5: Python Web Application on Kubernetes Engine (GKE)
Part 6: Python Web Application on Cloud Run
Part 7: Conclusion