I have a question regarding how to model a many-to-many relationship in App Engine:
A Blogentry can have many tags, a tag can apply to many blog entries.
I see a couple of scenarios:
Use a Set of Strings as an attribute on the blog entry.
- This allows me to easily query for an entry using a tag
- This does not allow me to fetch all tags and their weights (how many entries they apply to)
Use an unowned relationship between an Entry and a Tag class (Set of keys for Tags in Entry class and vise versa)
- This allows me to fetch all tags and their weights
- This is much more comples to maintain
- Are Set attributes lazyloaded, or would i fetch the entire graph of object every time? (Fetch an Entry, which fetches a number of Tags, each in turn fetching a number of Entries)
use 1. but maintain data on tags and their weights seperately
- This has synchronisation issues between the Tag data and the tags in the Entries
Any input and pointers would be appreciated. I think this i a quite common scenario but i haven't seen any good solutions yet.