r/GoogleAppsScript • • 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?

11 Upvotes

15 comments sorted by

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 ?

2

u/DVC888 Mar 10 '21

In this particular instance it's going to need Google logins and each user needs to see a dashboard (embedded from Data Studio) and edit certain values. Basically stuff that Google Sheets does well but getting everyone's sheets to synchronise was making things prohibitively complex.

I wanted to ask more generally because this is a situation a lot of my clients are either in or approaching. Since there is a need for this, I think that I could potentially offer a lot of value to these kinds of companies in terms of scaling beyond Google Sheets.

1

u/olgee0 Mar 10 '21

Yep .... In terms of speed of development this is exactly what Appsheets built for.... I see you're an apps script person... Am a dev on Appsheets & flutter....I can show you some samples in the chats... If you got the man power & infrastructure of Firebase n whatever frontend React/Firebase you'd be aiit but maybe check Appsheets out.....

1

u/DVC888 Mar 10 '21

I would be very keen to see some examples if you don't mind.

I've used Stacker with Airtable before so I'm guessing Appsheet is a similar deal,, right?

As you say, developing everything from scratch is very labour intensive so if there is a quicker and cheaper option for the client then that's a positive.

I've never used Flutter either. My default for front end stuff is React but I've heard flutter can be set up very quickly.

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.

https://i.stack.imgur.com/zufuC.png

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:

https://cloud.google.com/bigquery

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

u/[deleted] 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?