Python Writing to Google Cloud Storage: GoogleAppEngineCloudStorageClient VS google-cloud-storage

315 views
Skip to first unread message

Mitch Mitch

unread,
Mar 23, 2017, 6:05:29 PM3/23/17
to Google App Engine
Hello:

I'm converting a Python app to use GAE and I'm translating the storage provider from S3 to Google Storage.  Before I go too far down the rabbit hole.. I'm seeing two libraries to write to Cloud Storage. "GoogleAppEngineCloudStorageClient" and "google-cloud-storage"

Some docs say to use GoogleAppEngineCloudStorageClient

and some say to use google-cloud-storage

Which one is the best to use?

Thanks!
-Mitch

Anastasios Hatzis

unread,
Mar 24, 2017, 5:03:52 AM3/24/17
to google-a...@googlegroups.com
Mitch,

GoogleAppEngineCloudStorageClient is for use inside an App Engine app, that is accessing it through your deployed Python apps, and I would recommend this one for your case because of the good integration.

The others, Cloud Storage Client libraries, are for use in clients outside App Engine, for example a native Python app installed on a server, or a Python script running some cron jobs. Or maybe you want your JavaScript client to directly access Cloud Storage with-out going through App Engine first.

Hope this clarifies the difference :)

Anastasios


Mit freundlichen Grüßen / Kind regards

i. A.
Anastasios Hatzis

Fon: +49 8374 930813
Fax: +49 8374 930810
Mobil: +49 1520 8592878

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengine+unsubscribe@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/7090ef0d-21f3-4e0b-ace4-8a39cc8a86ec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


HATZIS Edelstahlbearbeitung GmbH
Hojen 2
87490 Haldenwang (Allgäu)
Germany

Handelsregister Kempten (Allgäu): HRB 4204
Geschäftsführer: Paulos Hatzis, Charalampos Hatzis
Umsatzsteuer-Identifikationsnummer: DE 128791802

http://www.hatzis.de/

Mitch Mitch

unread,
Mar 24, 2017, 9:29:47 AM3/24/17
to Google App Engine
It does!  Thats what I thought.  Thanks, I just wanted to make sure one was not outdated or the improper use of the library.

To follow up.  Is there a performance difference?

I'd like to keep the app provider agnostic (premature optimization) or if I end up hosting it natively or on GCE.  So if I code in a new storage lib, I'd like to keep it flexible.  But if it is much better / easier to use the GAE version, then I'll just use that.

Best,
Mitch

Anastasios Hatzis

unread,
Mar 24, 2017, 12:40:36 PM3/24/17
to google-a...@googlegroups.com
Mitch,

maybe someone with more knowledge about the flexible GAE environment or GCE can help regarding portability of code and if there are performance differences.

From my experience with only the standard GAE environment (Python with NDB/Datastore, GCS, Task Queue and a few other things), I don't think that portability is an easy task here. Of course, you can use WSGI, Django, webapp2 and so on, some standard features are conveniently wrapped (e.g. logging, GCS as file I/O, sockets) etc. But at the end of the day, GAE is a PaaS offering with nicely integrated services ready-to-go and easy to manage and scale ("batteries included"), and as such it is probably less portable than IaaS offerings. The NDB library for Datastore comes to my mind. I guess, you could use equivalent clients in the Cloud Python library to achieve a more portable solution for all of the features coming with the Standard environment, but then it might make more sense to pick the flexible GAE environment or even GCE. Each of the options come with their own pros and cons, really depends on your requirements and priorities/constraints.

Regarding the two GCS libraries specifically, I'm afraid they have different APIs.

AppEngine's lib reference:
Cloud Client lib reference:

Anastasios


Mit freundlichen Grüßen / Kind regards

i. A.
Anastasios Hatzis

Fon: +49 8374 930813
Fax: +49 8374 930810
Mobil: +49 1520 8592878

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengine+unsubscribe@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages