[Solved]-Using Google BigQuery as a backend for Django

4👍

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.

0👍

It is possible by using SQLAlchemy with Django.

SQLAlchemy can connect to bigquery with the pybigquery driver.

See the following about how to
Configuring Django to use SQLAlchemy.

👤Alonme

0👍

Everything is possible for sure. To create an interface would not be such a big job. But, I would just keep one note:

Bigquery is not intended to be backend database, rather it is more like data warehouse as it is defined within business intelligence discipline. This means, google will make it very hard for you to perform fast multi-user operations. As far as I can recall, update statements for example have have some thresholds.

On another hand, if this is purely for example data input, or visualisation of data, then why not. But then again, I think Azure power apps is kind of a product for it.

-1👍

You should have a db motor like postgres, mysql, whatever…
The point is, this db motor is necessary to have it, because the structure works in that way.

but of course, you can invoke google cloud from librarys in django and use it as

from google.oauth2 import service_account
from google.auth.transport.requests import AuthorizedSession
from google.cloud import datastore
from google.cloud import bigquery

in my case I used to connect
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = 'OAuth2Credential.json'

for generate your .json you should go to the documentation in:
https://cloud.google.com/iam/docs/creating-managing-service-account-keys

Leave a comment