google-cloud-datastore

How to think in data stores instead of databases?

狂风中的少年 提交于 2019-11-26 23:14:57
As an example, Google App Engine uses Google Datastore, not a standard database, to store data. Does anybody have any tips for using Google Datastore instead of databases? It seems I've trained my mind to think 100% in object relationships that map directly to table structures, and now it's hard to see anything differently. I can understand some of the benefits of Google Datastore (e.g. performance and the ability to distribute data), but some good database functionality is sacrificed (e.g. joins). Does anybody who has worked with Google Datastore or BigTable have any good advice to working

How do I use Google datastore for my web app which is NOT hosted in google app engine?

我是研究僧i 提交于 2019-11-26 23:06:25
I want to use datastore of google in my web app but do not want to host it in google app engine, I want to host it some other machine. So how i can use datastore in such web app ? will it be more economical ? Dan Cornilescu You would need to follow the Accessing the Cloud Datastore API from another platform procedure: This section shows how to activate and access the Cloud Datastore API from an external application running on a platform outside of Google Cloud. Enable the Cloud Datastore API for the project. You can enable the API for an existing project, or create a new project and then

Can datastore input in google dataflow pipeline be processed in a batch of N entries at a time?

会有一股神秘感。 提交于 2019-11-26 21:55:10
问题 I am trying to execute a dataflow pipeline job which would execute one function on N entries at a time from datastore. In my case this function is sending batch of 100 entries to some REST service as payload. This means that I want to go through all entries from one datastore entity, and send 100 batched entries at once to some outside REST service. My current solution Read input from datastore Create as many keys as there are workers specified in pipeline options (1 worker = 1 key). Group by

How to fetch more than 1000?

吃可爱长大的小学妹 提交于 2019-11-26 21:40:52
How can I fetch more than 1000 record from data store and put all in one single list to pass to django? Starting with Version 1.3.6 (released Aug-17-2010) you CAN From the changelog: Results of datastore count() queries and offsets for all datastore queries are no longer capped at 1000 . Just for the record - fetch limit of 1000 entries is now gone: http://googleappengine.blogspot.com/2010/02/app-engine-sdk-131-including-major.html Quotation: No more 1000 result limit - That's right: with addition of Cursors and the culmination of many smaller Datastore stability and performance improvements

Webservice credentials - OpenID/Android AccountManager?

隐身守侯 提交于 2019-11-26 21:39:52
I'm building a webservice and would like to use the user's google account credentials. The service runs on GAE and will have a web client and an Android native client. This is my first attempt of something like this and I've been reading about OpenID and the Android AccountManager library. I'm still not sure what are my options in terms of storing the users in my Datastore. What Identifier should I use ? Is it possible to use OpenID on a native Android application ? Any help and/or pointers would be appreciated. Thanks. We had a similar requirements on the last project: GAE backend with GWT

AppEngine: Query datastore for records with <missing> value

家住魔仙堡 提交于 2019-11-26 20:23:19
问题 I created a new property for my db model in the Google App Engine Datastore. Old: class Logo(db.Model): name = db.StringProperty() image = db.BlobProperty() New: class Logo(db.Model): name = db.StringProperty() image = db.BlobProperty() is_approved = db.BooleanProperty(default=False) How to query for the Logo records, which to not have the 'is_approved' value set? I tried logos.filter("is_approved = ", None) but it didn't work. In the Data Viewer the new field values are displayed as . 回答1:

How does one get a count of rows in a Datastore model in Google App Engine?

心已入冬 提交于 2019-11-26 20:09:48
问题 I need to get a count of records for a particular model on App Engine. How does one do it? I bulk uploaded more than 4000 records but modelname.count() only shows me 1000. 回答1: You should use Datastore Statistics: Query query = new Query("__Stat_Kind__"); query.addFilter("kind_name", FilterOperator.EQUAL, kind); Entity entityStat = datastore.prepare(query).asSingleEntity(); Long totalEntities = (Long) entityStat.getProperty("count"); Please note that the above does not work on the development

Storing hierarchical data in Google App Engine Datastore?

耗尽温柔 提交于 2019-11-26 18:59:34
问题 Can someone illustrate how I can store and easily query hierarchical data in google app engine datastore? 回答1: The best option depends on your requirements. Here's a few solutions (I'm assuming you're using Python, since you didn't specify): If you need to do transactional updates on an entire tree, and you're not going to have more than about 1QPS of sustained updates to any one tree, you can use the built in support for heirarchial storage. When creating an entity, you can pass the "parent"

How to delete all the entries from google datastore?

一世执手 提交于 2019-11-26 18:39:59
问题 I created a page to delete all entries from datastore. I am using self.key.delete() for this but it has stopped working (it worked once but it isn't working anymore). My python code to delete entries: class DeletePage(Handler): def get(self): self.key.delete() self.render('deletepage.html') 回答1: Assuming that: you're using the ndb library you have a models.py file with the entity models Then you can try something like this, hooked up in one of the app's handler: from google.appengine.ext

Is it possible to start two dev_appserver.py connecting to the same google cloud datastore emulator?

℡╲_俬逩灬. 提交于 2019-11-26 18:36:34
问题 Use case: I am developing an appengine standard application in python, and another one in go. I'd like to have the entities from both the applications in the same datastore. Is that possible? When I start the first dev_appserver.py with the flag --support_datastore_emulator=true , and with a specific --datastore_path , the gcloud beta emulators datastore env-init command fails with a ERROR: (gcloud.beta.emulators.datastore.env-init) Unable to find env.yaml in the data_dir [~/.config/gcloud