Ok, I just wanted to make sure that I wouldn't run into trouble later. Thanks, - Klaas Pieter
On Tuesday 17 January 2012 at 18:15, Jeff Schnitzer wrote: > There's nothing wrong with using a parent key that doesn't correlate > to a real entity. However, be aware that your write throughput for > that entity group will be limited to approximately one transaction per > second. > > I use this technique when synchronizing bulk data from a third-party. > I have a large mass of entities that are updated by a cron process > once a day. The data all lives under a single (fake) parent key. > Writes are done with bulk put()s; since they're all part of the same > entity group, the bulk put() gets around the one-write-per-second > problem. > > Jeff > > On Tue, Jan 17, 2012 at 4:06 PM, Klaas Pieter Annema > <[email protected] (mailto:[email protected])> wrote: > > I see the following pattern in the documentation to ensure strong > > consistency: > > > > user_key = db.Key.from_path('User', 'ryan') # Put two entities > > db.put([TestModel(parent=user_key), TestModel(parent=user_key)]) # Global > > query doesn't see the data. self.assertEqual(0, TestModel.all().count(3)) # > > Ancestor query does see the data. self.assertEqual(2, > > TestModel.all().ancestor(user_key).count(3)) > > > > I'm wondering if this is good practice. The parent of the TestModel is set > > to some contrived key that has no model associated with it. I'm currently in > > the process of migrating to HRD and can use this pattern to work-around some > > consistency probelsm. > > > > - Klaas Pieter > > > > -- > > You received this message because you are subscribed to the Google Groups > > "Google App Engine" group. > > To post to this group, send email to [email protected] > > (mailto:[email protected]). > > To unsubscribe from this group, send email to > > [email protected] > > (mailto:[email protected]). > > For more options, visit this group at > > http://groups.google.com/group/google-appengine?hl=en. > > > > > -- > You received this message because you are subscribed to the Google Groups > "Google App Engine" group. > To post to this group, send email to [email protected] > (mailto:[email protected]). > To unsubscribe from this group, send email to > [email protected] > (mailto:[email protected]). > For more options, visit this group at > http://groups.google.com/group/google-appengine?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
