Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 278651
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T01:16:22+00:00 2026-05-12T01:16:22+00:00

I would like to develop a Forum from scratch, with special needs and customization.

  • 0

I would like to develop a Forum from scratch, with special needs and customization.

I would like to prepare my forum for intensive usage and wondering how to cache things like User posts count and User replies count.

Having only three tables, tblForum, tblForumTopics, tblForumReplies, what is the best approach of cache the User topics and replies counts ?

Think at a simple scenario: user press a link and open the Replies.aspx?id=x&page=y page, and start reading replies. On the HTTP Request, the server will run an SQL command wich will fetch all replies for that page, also “inner joining with tblForumReplies to find out the number of User replies for each user that replied.”

select 
    tblForumReplies.*,
    tblFR.TotalReplies
from 
   tblForumReplies
   inner join 
     (
       select IdRepliedBy, count(*) as TotalReplies
       from tblForumReplies
       group by IdRepliedBy
     ) as tblFR 
     on tblFR.IdRepliedBy = tblForumReplies.IdRepliedBy

Unfortunately this approach is very cpu intensive, and I would like to see your ideas of how to cache things like table Counts.

If counting replies for each user on insert/delete, and store it in a separate field, how to syncronize with manual data changing. Suppose I will manually delete Replies from SQL.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T01:16:23+00:00Added an answer on May 12, 2026 at 1:16 am

    These are the three approaches I’d be thinking of:

    1) Maybe SQL Server performance will be good enough that you don’t need to cache. You might be underestimating how well SQL Server can do its job. If you do your joins right, it’s just one query to get all the counts of all the users that are in that thread. If you are thinking of this as one query per user, that’s wrong.

    2) Don’t cache. Redundantly store the user counts on the user table. Update the user row whenever a post is inserted or deleted.

    3) If you have thousands of users, even many thousand, but not millions, you might find that it’s practical to cache user and their counts in the web layer’s memory – for ASP.NET, the “Application” cache.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 190k
  • Answers 190k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Load a string like this as an NSString (maybe strip… May 12, 2026 at 5:57 pm
  • Editorial Team
    Editorial Team added an answer Unless you need the "call by reference" semantics, i.e. you… May 12, 2026 at 5:57 pm
  • Editorial Team
    Editorial Team added an answer You can do it like this: FROM appointments LEFT JOIN… May 12, 2026 at 5:57 pm

Related Questions

Akismet does an amazing job at detecting spam comments. But comments are not the
One thing I've always wanted to do is develop my very own operating system
I am using VS2008 to develop a WinForms 2.0 application. I have read about
Consider the need to develop a lightweight desktop DB application on the Microsoft platforms.

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.