Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Google BigQuery as a backend for Django

I am considering using Google BigQuery as a back-end for Django but cannot be certain if this is possible, and if it is, what settings would apply.

Currently, my Django application uses Postgresql, and the code in settings.py is as follows:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': 'mydatabase',
        'USER': 'mydatabaseuser',
        'PASSWORD': 'mypassword',
        'HOST': '127.0.0.1',
        'PORT': '5432',
    }
}

Ideally, I'd like to setup a database connection to Google BigQuery through settings.py and then use views and models as usual.

like image 545
Amit Avatar asked Sep 26 '17 20:09

Amit


People also ask

Can I use BigQuery in Python?

In order to make requests to the BigQuery API, you need to use a Service Account. A Service Account belongs to your project and it is used by the Google Cloud Python client library to make BigQuery API requests. Like any other user account, a service account is represented by an email address.

What is the backend of BigQuery?

BigQuery has become a major player in the field of Data analytics solutions. It provides an ever-growing list of powerful features in an easy, performant and cost-effective way. However BigQuery definitely is OLAP, while the sensible option for an application backend is OLTP.

Where does Django app deploy?

For hosting web applications built on Django, you will need to use a platform that lets you deploy the app. One of these platforms is Heroku. Heroku is a cloud platform on which users can build and deploy applications. Heroku relies on Git, a revision control system that lets you manage the program code of your app.


1 Answers

It's not possible, or at least not supported. You could use the API directly, but obviously you won't get any advantages of the ORM.

like image 178
Tom Carrick Avatar answered Oct 24 '22 01:10

Tom Carrick