From: Joby W. <joby@u.washington.edu> - 2002-10-07 16:30:45
|
Jeff Dairiki wrote: >>1) >>"SELECT groupname FROM $user_group_tbl WHERE username=$username" >> >>vs. >> >>2) > > (Group data in wiki pages) > > >>In #1 there is one DB call and in #2 there will be 1+N DB calls (where N >> >>is the number of groups). #2 is not going to scale up very well. > > > #1 requires an SQL backend as well as modifications to WikiDB (or > a separate interface to the SQL db). Correct this solution will be harder to impliment. Not only does it require the backend support for each DB, but there is also the need for administrative plugins (plugins that check permissions) to add people to groups and to create groups. > > There are speed issues with #2, but I don't think they're as bad > as Joby says. Each page belongs to only one group, so > for a given access we only have to check for membership in a single > group --- not all groups... You're correct Jeff. For each page that is a-r, g+r, and not owned by the viewer only one group page would need to be accessed (unless we allow groups to belong to groups, **shudder**). So most pages will not require the rendering of a group page. The 1+N problem comes into fruition in situations where we want to get all of the groups to which the user belongs. The example Reini put forward was if we want to limit searches to only pages the user can view. After some thought there is no reason we can't abstract this and do both (with a config option and WikiGroup::getGroup) with a group object that would be called within WikiRequest or WikiUser. Since the #2 is going to be FAR easier to impliment and #1 requires some other work done, #2 will be the proto-type. I'll have a mock up in the near future. jbw |