I'm working on a web-based productivity application. So I figure Google Drive SDK, in particular the Drive Realtime API, would be a good fit for this application.
I imagine that I should store documents as shortcut files with attached realtime models, for the following reasons.
However, I need to embed images (binary blobs). I can't store these in the realtime model, because it's not designed for large blobs. Please correct me if there's a way to embed binary blobs in to a realtime model.
So how do I associate binary blobs with a realtime model attached to a shortcut file?
The only approach I can think of is to store the blobs, in blobstore or the hidden appdata folder. And this would require me to do a cron job to garbage collect blobs, in case the shortcut file they are used in is deleted.
I would like to store the binary blobs on Drive (in the hidden appdata folder). This way users wouldn't be billed for drive storage for image storage specific to my app. I imagine that it would seem quite arbitrary to users if they have purchased Drive storage, and then have to purchase app specific storage for my app.
If you're willing to store metadata files on appdata, you don't need shortcuts. Touch a blank file on appdata for each blob that you store externally. Build collaborative functionality using these blank files.
You don't have to worry about the ownership of the appdata files, because they cant be changed by the user or another application.
We don't have a notification system at the moment to push changes at the moment. You can poll the changes resource to see if there are any deletions made. The garbage collection scheduling is about the size of the metadata and how you honor the user's quota. Users will be aware that they are losing data and that may affect your application where they are deleting your app's data.
You are correct that you probably don't want to store the binary blobs directly in the Realtime document, particularly if they are large, high quality images. This will bloat the model, and may cause problems if the size gets too big.
Storing them elsewhere in Drive and linking them into the document might make sense. However, the challenge is that you would need to make sure that all users on the document had permissions to see them. For this reason, I don't think the app data folder will work. I don't think you can share anything in that folder, so collaborators would not be able to see the images.
You might just store the files in regular folder. With the right UI, you could make it clear to the user what was happening so they understand why the files are there.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With