[google-appengine] Cross-reference multiple many-to-many relationships. How well does this perform on BigTable?

2013-09-19 Thread Tony França
Sometimes you just gotta ask the specialists. Help anyone?
http://stackoverflow.com/questions/18895586/cross-reference-multiple-many-to-many-relationships-which-database-should-i-pic

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [google-appengine] Cross-reference multiple many-to-many relationships. How well does this perform on BigTable?

2013-09-19 Thread Barry Hunter
In App-Engine DataStore (which while based on BigTable isn't actully
'BigTable')

You have StringListProperties

https://developers.google.com/appengine/docs/python/datastore/typesandpropertyclasses#StringListProperty

So can just store the tag(s) in a string list property on your CONTENT
model. No TC or TAG model!

You can actully filter string lists, where an equality query actually says
where the list contains this value. (case 2)

Can then do queries that look for entities, that contain this value AND
this value (3)

Can also combine one 'range' filter with such queries to do your (case 4)


Luckily, you can also mostly avoid a historic problem with multi-list
queries
https://developers.google.com/appengine/articles/indexselection#Exploding_Search


Basically you 'Normalize' the database. With a relational database you are
used to denormalizing, don't do it with DataStore.


With the datastore like this, you can't easily get a list of all tags,
with your RDMS could just query the TAG table. If need a list of tags,
store that seperately.




---

Also your TC.tag_key.IN, mentioned in the question. Looks for entities,
with EITHER of the tags mentioned in the query. Not both.
https://developers.google.com/appengine/docs/python/ndb/queries#repeated_properties

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/groups/opt_out.