Search code examples
c#asp.netsqlpermalinks

ASP.NET C# posts and comments permalinks or 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!


Solution

  • 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