Django apps that run on Google Cloud are running on the same infrastructure that powers all of Google's products, which generally improves the application's ability to adapt to a variable workload.
Hosting platforms
These are the available options for deploying Django on Google Cloud:
Django deployment option | Get started |
---|---|
App Engine standard environment | |
App Engine flexible environment | |
Cloud Run |
|
Google Kubernetes Engine (GKE) | |
Compute Engine |
For more details on the differences in these platforms, see App Hosting options on Google Cloud.
Databases
The Django object-relational mapper (ORM) works best with an SQL relational database.
If you are starting a new project, Cloud SQL is a good choice. You can deploy a PostgreSQL or MySQL database that's managed and scaled by Google, and supported by Django.
You can deploy Django with a Spanner backend using the python-spanner-django database backend.
Sometimes, there are compelling reasons to use a NoSQL database. Using the Django ORM with a NoSQL database is possible, with some limitations, but not officially supported by Django. There are a number of community-supported backend connectors Datastore, including djangae if you're using App Engine, or django-gcloud-connectors if you're using Cloud Run. If you choose to use MongoDB, you can deploy it using Cloud Marketplace and do your own management, or you can use the managed MongoDB hosting service provided by mLab.
Caches
Memorystore offers managed hosting options for both Memcache and Redis. For App Engine, see the guide for migrating from Memcache.
Task queuing
Pub/Sub offers messaging for event-driven systems, and Google Tasks offers asynchronous task execution; see the guide for choosing between Google Tasks or Pub/Sub. For App Engine, see the guide for migrating from Task queues.
Support for task queuing through Cloud Tasks is available through a number of community-supported packages.