google-cloud-datastore

How to filter datastore data before mapping to cloud storage using the MapReduce API?

风格不统一 提交于 2019-11-30 16:33:47
Regarding the code lab here , how can we filter datastore data within the mapreduce jobs rather than fetching all objects for a certain entity kind? In the mapper pipeline definition below, the only one input reader parameter is the entity kind to process and I can't see other parameters of type filter in the InputReader class that could help. output = yield mapreduce_pipeline.MapperPipeline( "Datastore Mapper %s" % entity_type, "main.datastore_map", "mapreduce.input_readers.DatastoreInputReader", output_writer_spec="mapreduce.output_writers.FileOutputWriter", params={ "input_reader":{ "entity

Please help me understand entity hierarchies in GAE's Datastore

有些话、适合烂在心里 提交于 2019-11-30 15:32:15
The Google App Engine Datastore allows each entity to have a parent entity , essentially a way to form an entity hierarchy . For example, an Employee can be addressed as: Company#521/Department#5/Employee#3 The entity id is only unique among entities with the same parent, so the full entity path is required to uniquely address it. So far, so good. But when should I model a parent-child relationship this way, rather than relying on a basic reference property within an entity, as I would in a traditional database? The only reason I can think of is to get around the lack of joins in a Datastore

What's the max length of a ListProperty?

懵懂的女人 提交于 2019-11-30 14:00:22
问题 How many items can be stored in a ListProperty? Is there a limit? 回答1: Entities are limited to 1MB in size (when encoded as a Protocol Buffer), so this provides a practical limit on the size of a list. Further, if the list is indexed, you're limited to 5000 entries before you get an exception because your entity has too many index rows. 回答2: In my experience you will get MemoryError exceptions deserializing ListProperties before you hit a hard limit. That used to happen to me with 5,000 to 10

GAE transaction failure and idempotency

陌路散爱 提交于 2019-11-30 13:57:34
问题 The Google App Engine documentation contains this paragraph: Note: If your application receives an exception when committing a transaction, it does not always mean that the transaction failed. You can receive DatastoreTimeoutException, ConcurrentModificationException, or DatastoreFailureException exceptions in cases where transactions have been committed and eventually will be applied successfully. Whenever possible, make your Datastore transactions idempotent so that if you repeat a

How to query parent entity from child entity in Google App Engine (Python) NDB/Datastore?

纵饮孤独 提交于 2019-11-30 13:53:10
问题 My question is very fundamental, I want to know straight forward and right way to access attribute values of parent entity from a child in App Engine Python. For example I have following model schema. I am using Python 2.7 and NDB. class Gallery(ndb.Model): category = ndb.StringProperty() title = ndb.StringProperty() subtitle = ndb.StringProperty() class Image(ndb.Model): blob_key = ndb.BlobKeyProperty() title = ndb.StringProperty() gallery = ndb.StringProperty() is_slider = ndb

When to use entity groups in GAE's Datastore

↘锁芯ラ 提交于 2019-11-30 12:18:04
Following up on my earlier question regarding GAE Datastore entity hierarchies , I'm still confused about when to use entity groups . Take this simple example: Every Company has one or more Employee entities An Employee cannot be moved to another Company , and users that deal with one Company can never see the Employee s of another Company This looks like a case where I could make Employee a child entity of Company , but what are the practical consequences? Does this improve scalability, hurt scalability, or have no impact? What are other advantages/disadvantages of using or not using an

GAE DataStore vs Google Cloud SQL for Enterprise Management Systems

杀马特。学长 韩版系。学妹 提交于 2019-11-30 11:36:00
问题 I am building an application that is an enterprise management system using gae. I have built several applications using gae and the datastore, but never one that will require a high volume of users entering transactions along with the need for administrative and management reporting. My biggest fear is that when I need to create cross-tab and other detailed reports (or business intelligence reporting and data manipulation) I will be facing a mountain of problems with gae's datastore querying

Checking if Entity exists in google app engine datastore.

廉价感情. 提交于 2019-11-30 10:52:56
What is the best/fastest way to check if an Entity exists in a google-app-engine datastore? For now I'm trying to get the entity by key and checking if the get() returns an error. I don't know the process of getting an Entity on the datastore. Is there a faster way for doing only this check? com.google.appengine.api has been deprecated in favor of the App Engine GCS client. Have you considered using a query? Guess-and-check is not a scalable way to find out of an entity exists in a data store. A query can be created to retrieve entities from the datastore that meet a specified set of

Downloading Google App Engine Database

北战南征 提交于 2019-11-30 10:36:57
I had created web application and deploy it in Google App Engine after I created table(entity) in Google App Engine datastore. My doubt is it possible to download the entity/database? ryan to enable remote_api , add this to your web.xml : <servlet> <servlet-name>remote-api</servlet-name> <servlet-class>com.google.apphosting.utils.remoteapi.RemoteApiServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>remote-api</servlet-name> <url-pattern>/remote_api</url-pattern> </servlet-mapping> details in this thread: http://groups.google.com/group/google-appengine/browse_thread/thread

App Engine: Can I upload my local dev_appserver.datastore to the live datastore?

寵の児 提交于 2019-11-30 10:34:54
I've been reading about the remote_api and the bulkloader.yaml configuration file for doing bulk uploads of Google App Engine, but all I really want to do is replace my live datastore on the cloud with the contents of my local datastore. From what I've read, it would seem that I have to first somehow convert my dev_appserver.datastore file into csv or xml, and then apply all the fancy transforms of bulkloader.yaml, which seems like a lot of unnecessary work. Anyone know if there's an easier way? Thanks! It might work to run download_data against localhost and then upload_data , using that dump