r/GoogleAppsScript • u/DVC888 • Mar 09 '21
Question Moving from Google Sheets to a real database
I work as a freelance Google Apps Script specialist so I'm hired by a lot of small companies who rely mainly on Google Sheets to manage their business.
Google Sheets is great and all but I'm sure everyone in this sub has come across instances where people over rely on this. This has been good for me in terms of getting work but ultimately, some businesses really need a proper database.
One of my clients is in this situation and he's keen on setting up a database as a single source of truth from which all sheets can be updated and to which all changes will be sent.
I don't have a load of experience with databases. I've done a few projects in Firebase and I'm comfortable with setting up Firebase functions to act as a backend. However, document databases also have their limitations and I feel like as something which will act as the backbone of a business, a relational database would be more suitable.
I'd be interested to hear if anyone else has helped in making a similar change to workflows. What have you done and what would you suggest?
2
u/captain_vee Mar 10 '21
BigQuery is awesome - you can very easily write appscript that loads data to and from your tables. Get creative with that and someone with no query knowledge can "query" the database while staying in google sheets
1
u/DVC888 Mar 10 '21
I was under the impression that big query wasn't meant for storing persistent data and is more a tool for querying large datasets. I was considering bigTable as an option.
1
u/captain_vee Mar 10 '21
I've always used bigquery for persistent data....my info may be outdated but last time I looked into it, bigtable had some limitations and couldn't perform more advanced sql operations and it is much slower. I'd recommend you look into the limitations of bigtable before you lock in your choice.
1
u/dimudesigns Mar 10 '21
The diagram linked below might help. It's a bit outdated (Firebase Realtime DB and Cloud Datastore have essentially been replaced by Cloud Firestore), but it offers a succinct break-down of the many storage solutions offered by Google's Cloud Platform.
1
u/dimudesigns Mar 10 '21 edited Mar 10 '21
BigQuery is great for data warehousing; it can store petabytes of information. Its ideal for capturing and querying against large data sets such as decades worth of historical records from a stock exchange or massive data streams/payloads coming from satellites/telescopes like Hubble etc.
However, if you plan on doing a lot of transactional operations, where existing fields/rows in a database are regularly modified...BigQuery is not the best option. Judging from OP's comments, it sounds like the app's end-users need to be able to edit/modify content regularly at a granular level. So something like CloudSQL or Cloud Firestore may be more suitable.
1
u/captain_vee Mar 10 '21
I'd have to disagree. In my experience uploading data daily at the end of the day from sheets to bigquery has been quite effective. I'm not sure why you think there size of the data matters.
2
u/dimudesigns Mar 10 '21
If you're uploading data in bulk, as in adding new rows and you're not trying to modify any existing data incrementally then Big Query is fine.
It's when you have a lot of low-level mutations/updates to existing data, as in several incremental and granular changes at the row and field level that's characteristic of applications that make heavy use of transactional operations. That's where BigQuery can fall short (and that's the point I was trying to make).
As for the amount of data you can store with BigQuery - well that's one of its major selling points. That's stated clearly on its home page and I quote:
Analyze petabytes of data using ANSI SQL at blazing-fast speeds, with zero operational overhead.
See for yourself:
1
u/DVC888 Mar 10 '21
That's really useful thanks. I'd seen something similar on one of the Google courses but somehow the flowchart is a lot clearer.
So in this particular case Cloud SQL is probably the best fit. I have another client who will just be adding rows that will never need to be modified so in that case, BigTable/BigQuery is best.
Wherever possible I'd prefer to use document databases but the more relational the data gets, the more disadvantages start to outweigh the benefits.
1
u/captain_vee Mar 10 '21
Ahhh I see....ok that makes sense. I wasnt assuming transactional operations like that, I was thinking more along the lines of appending daily data
8
Mar 09 '21
Cloud Sql is very simple to connect to from cloud functions.
Firestore is a good choice if you need UI binding to the data.
2
u/Strel0k Mar 10 '21
UI binding to the data
Not sure if I'm just being dumb, but can you explain what you mean by this?
4
u/olgee0 Mar 09 '21
I wish you were rocking with Appsheets even though it still uses Sheets as database. Moving to Firebase is cool too.. what's the frontend flutter ?, what's the functionalities needed like ?