我正在为一个朋友设计一个网站,但我不确定对于我的一个数据库表来说最好的方法是什么。给你一个想法,这大致就是我所拥有的
Table: member_profile
`UserID`
`PlanID`
`Company`
`FirstName`
`LastName`
`DOB`
`Phone`
`AddressID`
`website`
`AllowNonUserComments`
`AllowNonUserBlogComments`
`RequireCaptchaForNonUserComments`
`DisplayMyLocation`
最后四个
AllowNonUserComments
AllowNonUserBlogComments
RequireCaptchaForNonUserComments
DisplayMyLocation
(以及将来可能添加的更多此类布尔字段)将根据用户偏好控制某些网站功能。
基本上我不确定我是否应该将这些字段移动到
新表:member_profile_settings
`UserID`
`AllowNonUserComments`
`AllowNonUserBlogComments`
`RequireCaptchaForNonUserComments`
`DisplayMyLocation`
或者我是否应该将其保留为member_profile表的一部分,因为每个成员都会有自己的设置。
从长远来看,目标是大约 100000 名成员,在短期内是 10k 到 20k。我主要关心的是数据库性能。
虽然我遇到了问题 #2) 将成员的联系信息(例如地址街道、城市、州、邮编、电话等)移动到member_profile表中而不是像我一样拥有地址表和AddressID 是否有意义目前有。
谢谢