ASP.NET C# 帖子和评论永久链接或 sql
我正在开发某种“社交网络”,并为每个帖子创建了自己的评论系统,因为预计会有大量帖子和评论,我不确定 sql 是否是这里的最佳方法。
目前我在 Sql db 上有两个表:
Posts:
Columns: ID,PostText,DateTime,Username(that posted)
Comments:
Columns: ID,PostID(post which it belong),CommentText,DateTime,Username(that Commented)
我也想实现“Like system”,但随后我必须创建新表? 示例: 喜欢:
Columns: ID,PostID,Username(that liked) - to prevent double voting
可能会有很多刷新,我不太担心 Sql 可能会因为网站的高流量而让我头疼。
但我需要有 sql 和永久链接经验的人的建议。考虑到永久链接能够抓取链接,哪种效果更好。我也不确定大量文件(永久链接)是否会给我的主机带来麻烦。
如果您认为永久链接更好,您可以解释一种格式化它们并使用文件夹层次结构进行排序的方法,因为我从未使用过它。
谢谢!
I'm working on somekind of "social network" and have created my own comment system for every post, since large number of posts and comment is expected I'm not sure if sql is the best approach here.
Currently I have two tables on Sql db:
Posts:
Columns: ID,PostText,DateTime,Username(that posted)
Comments:
Columns: ID,PostID(post which it belong),CommentText,DateTime,Username(that Commented)
I would also like to implement "Like system" but then I would have to make new table?
exemple:
Like:
Columns: ID,PostID,Username(that liked) - to prevent double voting
There might be alot of refresing and I'm little worried that Sql might start giving me headaches with high traffic on website.
But I need advice from someone that had experiences with both sql and permalinks.Which works better given that permalinks have ability to be crawled for links. Im also not sure if large number of files(permalinks) would be trouble for my host.
If you think permalinks are better can you explan a way to format them and sort somehow using folder hierarchy since I've never worked with it.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你确实需要一个新的点赞表。
我认为如果你的流量很高,你应该有一个额外的历史表,并且你必须在这里保留旧的喜欢(例如超过一周的)或尝试对你的表进行分区。
但这些只是第一步,对于真正高流量的网站来说,还有很多工作要做。
莫泽尔
You really need a new table for likes.
I think if you have high traffic, you should have an additional history table and you have to keep old likes (for example older than a week) here or try to partition your table.
But these will the first steps there will be a lot of work with really high traffic sites.
Morzel