PDA

View Full Version : Integer Key Sizing


galt
10 Apr 2002, 01:25
As two of you know, I am proceeding along with my modest yet poweful CMS that loosely couples with vBulletin.

I am seeking some design perspective.

JelSoft chose to implement usergroupid as a smallint(5). I believe that I want to expand that in areas where my system touches vB. Would it be a bad idea to have one table (vB) keyed by usergroupid (smallint-5) and another (my) table keyed by usergroupid (int-11). Any issues with joining the two tables ?

Mark Hensler
10 Apr 2002, 07:29
Ideally, these would be of the same size.

Besides, what the heck are you doing that would require you to need that many usergroups?

galt
10 Apr 2002, 07:40
Well I know that ideally they would be the same. The question is, will something blow up in the future if they are different sizes (assume the data is consistent)?

I am looking at ways to individually customize content for each user. 32,000 groups is not enough if I attack it that way. But it is not a complete plan yet, and I am thinking I may go a different way. But a different way looks like it means two different authorization systems with some kind of toggle (group vs user level auth). By extendingthe "group" approach, I thought I could make it all fall out nicely. The real problem IMHO is that vB only allows each user to be in one group. Maybe they will fix this in v3?

I will figure it out by the weekend. Thanks.

Chen
10 Apr 2002, 11:52
If you are doing it on a per-user basis, just use the userid to identify the user. Like access masks I suppose.

Originally posted by galt
The real problem IMHO is that vB only allows each user to be in one group. Maybe they will fix this in v3?
Hmm... gee I don't know. ;)

galt
10 Apr 2002, 14:02
Well sure, userid gives per user control, but loses the ability to group people together. It is obvious.

I always design for the extremes, and let everything in the middle take care of itself.