Mind that for each user you have auth.user_groups = { group_id: group_obj, ... }
this allows you to efficiently do: if group_in in auth.user_groups and it can also be used a map to convert the group_id to the group_obj.role and vice versa. the dict is automatically updated when the user does add_membership, del_membership. It is not updated for logged-in user when the administrator changes membership until the user logs in again. massimo On Tuesday, 24 July 2012 14:39:11 UTC-5, Alec Taylor wrote: > > I was also worried that running queries such as "is user in this group?", > "how many events does this group have?" would be much less efficient with > everyones data in one place. > > But it's probably just a perception thing, as you say, and it sounds like > the drawbacks outweigh the benefits... :\ > > So thanks for alleviating my concerns > > On Tuesday, July 24, 2012 9:57:46 AM UTC+10, pbreit wrote: >> >> On Monday, July 23, 2012 3:01:40 PM UTC-7, Cliff Kachinske wrote: >>> >>> > Separate DBs sounds messy. >>> >>> Some elaboration on that point. >>> >> >> Everything that is simple to do on one DB becomes complicated to do on >> multiple DBs. For example, I run a multi-tenant site that I constantly run >> queries against all tenants. That would be a pain with separate DBs. Same >> with migrations, backups, etc. >> >> And I don't see much actual benefit of splitting into multiple DBs. The >> benefits I hear about seem mostly perceptual (data isolation, etc). >> > --