SagiLow
SagiLow

Reputation: 6029

Best way of getting Image in Android from AppEngine server (Blob vs URL)

I use appEngine and datastore to store images (using blobstore API).
Now I want to get an image from the server and I wonder what is better, getting the image as blob or getting the URL from the server and manually downloading the image from the given URL.
I don't need cache since each request will need to get each image only once a 'lifetime'.
I think the URL method will make me use more requests than the blob method.

Any pros and cons I should think of ?

Thank you.

Upvotes: 1

Views: 111

Answers (1)

GAEfan
GAEfan

Reputation: 11360

Over the years, I have migrated from BlobProperty to Blobstore to Cloud Storage. I can testify that GCS is the best way to store and retrieve images. It is not a difficult migration, and I'd recommend it. For one, users can retrieve the images without hitting your GAE instance. The request goes to GCS. Highly efficient.

If using blobstore, then you are correct. Retrieving the image via url is another request, with a separate handler on your part. Your call to the blobstore directly, while processing the request, is more efficient.

The advantage of GCS here is that the url call would be pushed off to the user's browser. Yes, another request, but not a load on your instance.

Upvotes: 1

Related Questions