google-cloud-datastore

Can I access Datastore entities of my other Google App Engine Applications

偶尔善良 提交于 2019-11-26 17:49:14
问题 As we know, in Google App engine, for each registered email account, we are allowed to make 10 applications. Now, I need to share entities among the applications. Is this possible? If yes, how is it implemented? 回答1: No, this cannot be done. However, as Nick Johnson points out, you can use remote_api to do what you need. 回答2: Are you sure you really need to do this? Don't forget, you can have multiple versions of an application running against the same datastore. Only 1 version of the app is

Copy an entity in Google App Engine datastore in Python without knowing property names at 'compile' time

吃可爱长大的小学妹 提交于 2019-11-26 17:31:21
问题 In a Python Google App Engine app I'm writing, I have an entity stored in the datastore that I need to retrieve, make an exact copy of it (with the exception of the key), and then put this entity back in. How should I do this? In particular, are there any caveats or tricks I need to be aware of when doing this so that I get a copy of the sort I expect and not something else. ETA: Well, I tried it out and I did run into problems. I would like to make my copy in such a way that I don't have to

App Engine datastore does not support operator OR

牧云@^-^@ 提交于 2019-11-26 17:07:49
问题 I am trying to query the google datastore for something like (with pm --> persistanceManager): String filters = "( field == 'value' || field == 'anotherValue' )"; Query query = pm.newQuery(myType.class, filters); When I execute - I am getting back: App Engine datastore does not support operator OR . What's the best approach in people experience for this kind of queries? Any help appreciated! 回答1: Perform multiple queries. The Datastore, like all other databases, isn't able to efficiently

How do I define a unique property for a Model in Google App Engine?

♀尐吖头ヾ 提交于 2019-11-26 15:24:15
问题 I need some properties to be unique. How can I achieve this? Is there something like unique=True ? I'm using Google App Engine for Python. 回答1: There's no built-in constraint for making sure a value is unique. You can do this however: query = MyModel.all(keys_only=True).filter('unique_property', value_to_be_used) entity = query.get() if entity: raise Exception('unique_property must have a unique value!') I use keys_only=True because it'll improve the performance slightly by not fetching the

Store Photos in Blobstore or as Blobs in Datastore - Which is better/more efficient /cheaper?

喜欢而已 提交于 2019-11-26 15:18:48
问题 I have an app where each DataStore Entity of a specific kind can have a number of photos associated with it. (Imagine a car sales website - one Car has multiple photos) Originally since all the data is being sourced from another site, I was limited to having to store the photos as DataStore Blobs, but now that its possible to write BlobStore items programatically, I'm wondering if I should change my design and store the photos as BlobStore items? So, the question is: Is it 'better' to store

Google App Engine: Is it possible to do a Gql LIKE query?

筅森魡賤 提交于 2019-11-26 11:05:36
Simple one really. In SQL, if I want to search a text field for a couple of characters, I can do: SELECT blah FROM blah WHERE blah LIKE '%text%' The documentation for App Engine makes no mention of how to achieve this, but surely it's a common enough problem? Dave Webb BigTable, which is the database back end for App Engine, will scale to millions of records. Due to this, App Engine will not allow you to do any query that will result in a table scan, as performance would be dreadful for a well populated table. In other words, every query must use an index. This is why you can only do = , > and

Contention problems in Google App Engine

家住魔仙堡 提交于 2019-11-26 09:58:29
问题 I\'m having contention problems in Google App Engine, and try to understand what\'s going on. I have a request handler annotated with: @ndb.transactional(xg=True, retries=5) ..and in that code I fetch some stuff, update some others etc. But sometimes an error like this one comes in the log during a request: 16:06:20.930 suspended generator _get_tasklet(context.py:329) raised TransactionFailedError(too much contention on these datastore entities. please try again. entity group key: app: \"s~my

GAE ndb design, performance and use of repeated properties

蹲街弑〆低调 提交于 2019-11-26 09:51:28
问题 Say I have a picture gallery and a picture could potentially have 100k+ fans. Which ndb design is more efficient? class picture(ndb.model): fanIds = ndb.StringProperty(repeated=True) ... [other picture properties] or class picture(ndb.model): ... [other picture properties] class fan(ndb.model): pictureId = StringProperty() fanId = StringProperty() Is there any limit on the number of items you can add to an ndb repeated property and is there any performance hit with storing a large amount of

How to think in data stores instead of databases?

强颜欢笑 提交于 2019-11-26 08:39:11
问题 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.

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

倾然丶 夕夏残阳落幕 提交于 2019-11-26 08:35:53
问题 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 ? 回答1: 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