- That’s ok to store number of replies for every post.
But instead of storing it into Post table, store number of replies to PostCommentCount table.
(PostId uniqueidentifier, CommentCount int)
One record in Post table would match with one or zero records in PostCommentCount table.
- Another problem with locks in SQL Server is that typically SQL Server locks not just one record, but whole Page or even whole table.
P.S.: I’m really missing ability to edit my comments (or at least delete them so I can replace them with corrected ones).