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

  • SEARCH
  • Home
  • 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 7742173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:12:56+00:00 2026-06-01T09:12:56+00:00

For stackoverflow.com there is a stat for how many views for a question. How

  • 0

For stackoverflow.com there is a stat for how many views for a question.

How is it tracked? Registered and unregistered user can view any question.

What is the database relation schema for that counting?

Should i just increment the column value for a specific question in database table?

Or should i add a new record/row when an user views that question, then to display the count echo the result of sum(thatcolumn) of that table?

  • 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-06-01T09:12:58+00:00Added an answer on June 1, 2026 at 9:12 am

    There are numerous approaches to this. there’s the two you mentioned but there are others that will depending on your situation suit you better.

    if you have a lot of hits to your site like stackoverflow does, incrementing the counter on a database table when one person views the question can be quite expensive (depending how their db is set up i’m not sure).

    another approach which I’ve use before is to store the views in a cache engine like memcache/xcache/eaccelerator (each of these have their own merits) and have a cron that will run hourly/nightly/etc. that will clean up the views and insert into a database table that is referenced by the unique id in SO.com’s case the question id, and reset the counters in the cache.

    If you want total reliability a noSQL engine like mongoDB would be excellent at quick and efficient key value data storage.

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

Sidebar

Related Questions

In answering this question ( https://stackoverflow.com/questions/352317/c-coding-question#352327 ), it got me wondering... Is there any
These ribbon in stackoverflow and uservoice.com looks nice. is there any javascript library/jquery plugin
For example: http://stackoverflow.com/questions/396164/exposing-database-ids-security-risk and http://stackoverflow.com/questions/396164/blah-blah loads the same question. (I guess this is DB
I know there is plenty of question answered over here https://stackoverflow.com/questions/tagged/youtube+regex , but not
In stackoverflow.com I have found a question where a user was suggesting to use
I want to continue on my previous question: https://stackoverflow.com/questions/3007168/torrents-can-i-protect-my-software-by-sending-wrong-bytes Developer Art suggested to add
I know you answered a similar question on ICS here: https://stackoverflow.com/a/8320504 But there is
From this question:- https://stackoverflow.com/questions/1342611/is-there-a-webservice-api-to-grab-a-screenshot-of-another-website and some other questions/google I got some results like:-- http://www.bitpixels.com/
I've read this: https://stackoverflow.com/questions/631850/how-do-you-name-your-many-to-many-relationship-tables But my question is a little different. I'm just wondering
When a user clicks on a link <a href=http://www.stackoverflow.com target=_blank>click</a> is there a way

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.