I developed an android app with google app engine as a server.
Now I want to add photo sharing feature in my app,
Google app engine provides Cloud Datastore/Cloud Storage for large data like images.
My question is that is Cloud Datastore an efficient way for storing and retrieving images or any other third party database is more efficient than Cloud data store/cloud storage.
Please guide me and give me your helpful suggestions.
Cloud Storage is a better solution than a database for storing and serving images, and allows you to do things like Signed URLs (serving content directly, securely).
Directly from the "Choosing a Storage Option" page:
Google Cloud Storage
Description: A scalable, fully-managed, highly reliable, and cost-efficient object / blob store.
Good for:
Images and videos
Objects and blobs
Unstructured data
Related
I am developing an Android application for a facebook page. More specifically I want to display post images as part of a feed. The way I have achieved this thus far is by using restfb along with Graph API, making requests to Graph API, receiving the images and displaying them to the feed.
My concerns are the following:
I heavily rely on the access token facebook gives me for accessing those images and other page data.
Whether, if theoretically the traffic of the application increases, can it be supported by Graph API, both performance-wise and logic-wise(extension of the access token troubles me for multiple devices).
Considering the above I have decided to go with a server-based approach. That means storing just images to the server instead of posting them on facebook. Is there an Android specific approach when building a server? Any specific documentation I should read?
UPDATE:
I decided to go with a Firebase Storage approach where I will upload images to the Storage and download them into my application.
I have to store images from android app in Azure SQL database, I have tried to search on stack-overflow and googled it on many other sites , but I couldn't find an appropriate answer. I have seen some way on some sites but It was in C#, but I am a java guy. I tried it to find a way on Azure portal, where I just found a Easy Table function through which I can just make a table with no data type to save image.
Plase suggest me a way.
My task is that I have to save one image and 2-3 text strings through android app.
Thanks in advance.
Per my experience, normally saving images in Azure SQL Database is not a good idea. On Azure, the best practice is creating an Azure Mobile App instance to handle the request to save images using Azure Blob Storage. But by now, the Azure Mobile App only supports C# & NodeJS, and I think NodeJS is easy for you, which is express.js on Azure. Please see the tutorial below to know them.
How to use the Azure Mobile Apps Node.js SDK
How to use Blob storage from Node.js
Or you can directly use Azure Blob Storage in Android, that you can refer to the offical documents & samples.
Sample: Azure Storage Service - Photo Uploader Sample for Android
Library: Azure Microsoft Azure Storage SDK for Android
Tutorial: How to use Blob storage from Java
However, to save images in Azure SQL Database via easy table is a required needs. My suggestion is as below.
Encode image within Base64 to a string
Split the Base64 string to a string array, and make sure the length of the array string item is less than the length of the defined character column.
Save the index of the above array as a table column to easy table, then you can recover the Base64 string of image via concat the string array by the index.
Hope it helps.
The BlobStore API is marked as 'superseded' also limited to Limits to 32 MB.
The Google Cloud Storage is a vendor lock-in.
Is there a way to upload blobs with a 3rd part lib
In Google App Engine (not flexible / managed-vms) for example JClouds
And how would one bypass the 60 Seconds request limit that causes DeadlineExceededException?
To enhance the question;
Security is an issue, it would be preferably to run every request trough the application, so also blob uploads. Which makes the 60 seconds an issue.
The seperate uploadUrl is an option, but i do not wish to use BlobStore or Cloud Storage, but is there a generic way to handle things like this in GAE?
32MB is not a limitation of the BlobStore, but rather request playloads that go to your GAE app. You can upload larger files to both Cloud Storage and the BlobStore by creating a temporary URL for the user to submit the file to, which does not go through your ap, but rather goes directly to the storage service. You can find documentation about that for blobstore here. I don't personally use Cloud Storage, so I don't the a documentation link handy.
You can certainly use any other service in a similar way, but I'm afraid I can't explain how other than to say "consult their documentation". I know that's not a great answer to your question, but maybe insight into how it works with Google's products will help you understand how to use a 3rd party as well.
As for the 60 second request limit: since your upload requests cannot go through your server anyway, this is a non-issue. The 60 second limit only applies to requests made directly to your app.
All,
I have a google application engine (java) that requires to store some images. I tried using Blobs and storing them in datastore but as you know there is a size limit on data that can be stored in datastore.
So as result I'm storing the images on a different server and store the path in my datastore and all works fine.
Now I'm thinking on using a google drive folder instead of using a server to upload the files to the drive and using the share link to display them later.
I've seen https://developers.google.com/drive/web/quickstart/java and got it to work fine. When I try to use it in my application however obviously this won't work as the code is assuming a credential for a local user.
I created a service key on my application and want to change the sample code above to use it but I'm not sure if that's the correct approach.
Tried searching for samples but can't find anyone that takes the same approach. Is there a working sample that shows how to authenticate an application not a user and let's say store a file in google drive?
I've also seen https://developers.google.com/drive/web/examples/ please note what I want is to store files in my google drive and not the user's google drive. So if user A and user B come to my app, they shouldn't have to authorize my application and should both be able to upload a file to my google drive.
I don't know if this can be done directly from their browser or I have to move the file to my application (appspot) and then push it to google drive.
Thanks
I design an mobile app which can upload photo on GAE.
These photos can not be changed, only displayed on other mobiles. Through my application, the picture will be sent only on GAE, and downloaded to the mobile clients. That's all!
I only use GAE for store photos, and datastore for store photo's data string (Like position, age...)
Do you think I have to go on the Cloud Storage (Because I would be locked after a while?), or I can stay on the Blobstore ?
I fear that in the future the Blobstore was deprecated..
Thanks !
Use GCS because:
Google is moving away from the blobstore
GCS offers more functionality like acl, folders, and more.
You can use filenames and a blobstore like serving url for images
You can create serving url's for non images
GCS is cheap and has a free default bucket
Blobstore vs. Cloud Storage is an ongoing debate. check out these resources:
Google Blobstore versus Google cloud storage
If you're storing an image Blob in App Engine, should you put it in the Blobstore or Google Cloud Storage?
Comparing Blobstore and Google Cloud Storage
Relative to Google itself, there no good reasons to use blobstore to store files because Cloud Storage is made to do this.
I think Google will deprecate the Blobstore soon...