我想建立一个电子教学网站的线程论坛(opensource asp.net mvc ofcourse,虽然这对这个问题无关紧要)。线程论坛的最佳DB结构是什么?
什么应该是数据库结构,这将有助于检索论坛张贴与最佳性能?我不会拒绝。因为它可能随着检索行数的变化而变化。
此外,我应该能够链接一个特定的线程与另一个线程。例如。显示“相关论坛链接”。
我使用SQL Server 2005的
下面是我的想法(无耻地把它从) Stephen Walther Excellent blog post
表结构:论坛
· Id
· ParentId (null if this is the first message)
· ParentThreadId (Identify message in the same thread)
· Author
· Subject
· Body
· PostedDate
表:RelatedForum
· ForumId
· RelatedForumId
Ideas /建议表示欢迎。
在此先感谢。
感谢您的回复。我仍然会继续提出这个问题以获得更多的意见,因为我还有一些时间来完成整体设计。 – 2008-12-12 15:28:46