Reputation: 279
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.
Upvotes: 27
Views: 44368
Reputation: 61
If you wanted to create a relational database on Google Drive you could create a SQLite DB since it is server-less.
Upvotes: 0
Reputation: 19835
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.
Upvotes: 14