google-cloud-datastore

Google Cloud Datastore vs Firebase

为君一笑 提交于 2019-12-03 00:43:43
问题 Google provides two cloud based data storage services Google Cloud Datastore and Firebase (after its acquisition). While typical usage scenarios are provided to enable a developer to make selection between various services provided by the Google cloud platform, there is no mention of how Firebase fits into the picture in its current / future development. Can anybody picture some insight on the matter and provide typical use cases for Google Cloud Datastore vs Firebase? 回答1: Google has already

Improve App Engine performance by reducing entity size

為{幸葍}努か 提交于 2019-12-03 00:27:01
The objective is to reduce the CPU cost and response time for a piece of code that runs very often and must db.get() several hundred keys each time. Does this even work? Can I expect the API time of a db.get() with several hundred keys to reduce roughly linearly as I reduce the size of the entity? Currently the entity has the following data attached: 9 String, 9 Boolean, 8 Integer, 1 GeoPt, 2 DateTime, 1 Text (avg size ~100 bytes FWIW), 1 Reference, 1 StringList (avg size 500 bytes). The goal is to move the vast majority of this data to related classes so that the core fetch of the main model

GAE NDB Datastore new feature: Access Datastore entities from other GAE app

南楼画角 提交于 2019-12-03 00:08:22
Reading the new documentation of GAE NDB Datastore: https://cloud.google.com/appengine/docs/python/ndb/modelclass#class_methods get_by_id(id, parent=None, app=None, namespace=None, **ctx_options) Returns an entity by ID. This is really just a shorthand for Key(cls, id).get() . Arguments id A string or integer key ID. parent Parent key of the model to get. app (keyword arg) ID of app. If not specified, gets data for current app. namespace (keyword arg) Namespace. If not specified, gets data for default namespace. **ctx_options Context options Returns a model instance or None if not found. I

How to make the argument to filter() a variable?

六眼飞鱼酱① 提交于 2019-12-02 21:57:53
问题 I have this model class Item(db.Model): ... glam = db.StringProperty() casual = db.StringProperty() speaking = db.StringProperty() and this handler with a form with radio buttons: class SortForm(webapp.RequestHandler): def get(self): self.response.out.write(""" <form name="submit_form" action="/sortformhandler" method="post"> Category: <input type="radio" name="image" value="image"> Image <br /> Sorty by tag: <br /> <input type="radio" name="tag" value="glam" /> Glam <br /> <input type="radio

Availability date range queries in app engine datastore?

为君一笑 提交于 2019-12-02 21:28:11
问题 I've looked through a bunch of other threads on this topic, and so far I haven't found any satisfactory answers, so I wanted to double check if it's really just not feasible with the datastore. In the datastore I have a set of entities that can be booked for particular time periods, and thus they have availability ranges attached to them. An AvailabilityRange entity has a start and end date, and I want to find all the AvailabilityRanges that completely encompass a desired date range. In SQL

How to estimate hosting services cost on GAE?

烈酒焚心 提交于 2019-12-02 21:01:09
I'm building a system which I plan to deploy on Google App Engine . Current pricing is described here: Google App Engine - Pricing and Features I need an estimate of cost per client managed by the webapp. The cost won't be very accurate until I have completed the development. GAE uses such fine grained price calculation such as READs and WRITEs that it becomes a very daunting task to estimate operation cost per user. I have an agile dev. process which leaves me even more clueless in determining my cost. I've been exploiting my users stories to create a cost baseline per user story. Then I

Handling Schema Migrations in App Engine

a 夏天 提交于 2019-12-02 20:21:25
问题 I've updated several of the heavily-used NDB models in one of my App Engine applications by moving a few properties between them. As such, some models now contain data that previous versions of my application would look to find in different places (and fail in doing so). I have updated my handlers to make sure that this will not happen after I run a migration that will accompany my release. However, I am concerned about what will happen while the schema is migrating. I've tested my migration

GAE NDB install deployed

左心房为你撑大大i 提交于 2019-12-02 20:19:32
问题 My Google App Engine app uses Datastore NDB. So I am importing: from google.appengine.ext import ndb but when I deploy and go to my app there is an error: ModuleNotFoundError: No module named 'google.appengine' so how do I get GAE to install this part of the Google Cloud SDK? 回答1: You didn't say which runtime you're trying to deploy to (Python 2.7 or 3.7) but I'm guessing it's 3.7. The google.appengine module is only available in the first-generation Python 2.7 runtime. If you need to use it,

Can one application access other applications data querying the key in Google App Engine?

和自甴很熟 提交于 2019-12-02 19:23:56
问题 It would be an enormous security flaw if it does. Proposed method: entity = db.get(key) source: http://code.google.com/appengine/docs/python/datastore/creatinggettinganddeletingdata.html#Getting_an_Entity_Using_a_Key 回答1: No. But you could do it using remote_api (and with the permission of the other app's owner). 回答2: No you cannot, unless there is a particular bug you have discovered. Is there any particular reason you think it is possible? This seems fairly easy to test, if you are worried

Fetching just the Key/id from a ReferenceProperty in App Engine

北城余情 提交于 2019-12-02 19:18:30
I could use a little help in AppEngine land... Using the [Python] API I create relationships like this example from the docs: class Author(db.Model): name = db.StringProperty() class Story(db.Model): author = db.ReferenceProperty(Author) story = db.get(story_key) author_name = story.author.name As I understand it, that example will make two datastore queries. One to fetch the Story and then one to deference the Author inorder to access the name. But I want to be able to fetch the id, so do something like: story = db.get(story_key) author_id = story.author.key().id() I want to just get the id