25

Can I use Google Drive as a per user database?

I need private online database storage for each user of my app.

For example, user 1 needs to store entries in a database table with a list of his online meetings.

User 2 also needs to store entries in a similar table. Neither user should be able to see each other's entries.

Google Drive gives developers access to app folder : https://developers.google.com/drive/android/appfolder

The documentation states App Folder can be used to store configuration files, temporary files, or any other types of files that belong to the user but should not be tampered with.

I am happy to create a file-based database which either has a single file to represent a whole database table (in this case all meetings) or one file per row of the database table (a single meeting).

Is this something I can store in Google Drive app folder?

I understand there is a quota in Drive API per app but this seems very high and not prohibitive. Users themselves should have plenty of online storage on Google Drive to store the files I would need. I am looking into Firebase too but Google Drive would be a much cheaper solution and well understood by potential users.

Kara
  • 6,115
  • 16
  • 50
  • 57
Steve Robson
  • 259
  • 1
  • 3
  • 4
  • I'm not sure but I don't think it's a good idea. I recommend you to use Parse.com. – CodeMonster Jul 28 '15 at 01:09
  • 1
    http://kovalent.co/blog/google-docs-as-a-backend/ seems you can but why bother to use google drive as database when aws provides 1-year free database of 20gb. – Ken Kwok Jul 28 '15 at 01:16
  • 8
    20gb is nothing when you have many users. drive will scale and yours wont. – Zig Mandel Jul 30 '15 at 14:10
  • 1
    Can you please clarify in which situation a Google drive db file would be better than a local db file since you are not doing any cross-user access to the db? – leoinlios Feb 05 '19 at 04:06
  • 5
    @leoinlios It's a simple way of backing up your data to hedge against device failure. Or to have cross-device access to the DB if you have a tablet and phone, for example. Or if you want some non-Android code to easily access your data. – user1713450 Jun 10 '19 at 04:40

2 Answers2

12

Yes, it's possible to do that. It will work fine, because each user has their own data in their own drive. You can store as much data you want in that special folder, as long as it doesn't fill the entire drive quota.

Personally, I've done this using spreadsheets for my "database". I don't query directly the spreadsheet. Instead I incrementally sync it to a local DB on the device and only read starting from the last row I synced last. Very fast to sync like that.

You don't say where your app runs, but on Chrome desktop you even have a Chrome filesystem sync which stores in the user's Drive and syncs automatically to other chrome devices.

Zig Mandel
  • 19,571
  • 5
  • 26
  • 36
  • can you please point to some documentation for Android apps to use the Chrome sync API? For example, I am looking to use Google Drive to store images for a Progressive Web App. – Alexander Mills Jan 21 '19 at 22:59
0

If you wanted to create a relational database on Google Drive you could create a SQLite DB since it is server-less.

  • This does not really answer the question. If you have a different question, you can ask it by clicking [Ask Question](https://stackoverflow.com/questions/ask). To get notified when this question gets new answers, you can [follow this question](https://meta.stackexchange.com/q/345661). Once you have enough [reputation](https://stackoverflow.com/help/whats-reputation), you can also [add a bounty](https://stackoverflow.com/help/privileges/set-bounties) to draw more attention to this question. - [From Review](/review/late-answers/32895549) – Tirolel Oct 14 '22 at 09:12