update StructuredProperty

38 views
Skip to first unread message

Handerson Contreras

unread,
Sep 29, 2014, 5:41:29 PM9/29/14
to appengine-...@googlegroups.com
hi!!

What is the best practice for to manage relashionship in ndb?
if i have a lot of ocurrences of  a entity in diferents entities with StructuredProperty. How can i do update them?

Beech Horn

unread,
Sep 30, 2014, 1:15:30 AM9/30/14
to appengine-...@googlegroups.com
Use a KeyProperty and point at another entity.

Apologies if I am confused and reading more into your question than is there, however the following is what I'd tell any of my friends working in GAE for the first time:

When you use an object database like a relational database you will be disappointed. Google do offer SQL support if that is what works best for your application.

A good rule of thumb would be when showing a page for an entity if it requires more than one .get() (apart from a global like a Config or similar) then be very clear that you need this. So for instance I'd be looking at this shared entity and thinking do I really need to update it globally - does it belong as a entity in its own right - does it have enough unique fields of its own? If so then split it out and reference with a KeyProperty. You pay a penalty for two gets per page whereas there is no real penalty for being inefficient sith storage (sorting data more than one) generally the reverse is true of SQL.

Also worth remembering that StructuredProperty is just to add structure to a property (e.g. dot notation for convenience) technically it's just like having normal properties added to your main entity.

Hope this helps and again apologies if this is something you are already aware of.
--
You received this message because you are subscribed to the Google Groups "appengine-ndb-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to appengine-ndb-di...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Handerson Contreras

unread,
Sep 30, 2014, 10:36:34 AM9/30/14
to appengine-...@googlegroups.com
really, is my first time with GAE.

the problem with relational database is the time in queries, and i need to do them more fast. but my thought is with database relational.

thank you.

--
You received this message because you are subscribed to a topic in the Google Groups "appengine-ndb-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/appengine-ndb-discuss/WZ-pv2o91j0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to appengine-ndb-di...@googlegroups.com.

Peter Retief

unread,
Sep 30, 2014, 10:45:15 AM9/30/14
to appengine-...@googlegroups.com
You might want to look at also combining full text search with your model relationships



Handerson Contreras

unread,
Sep 30, 2014, 11:14:57 AM9/30/14
to appengine-...@googlegroups.com
great!!

so,  you recommend to me to use keyproperty instead of StructuredProperty to manage relationships.
and for the searches the use of indexes?.

Peter Retief

unread,
Sep 30, 2014, 11:17:01 AM9/30/14
to appengine-...@googlegroups.com
you make it sound bad when you say it like that :)
Reply all
Reply to author
Forward
0 new messages