How do Stack Exchange sites track visited and consecutive days? I would like to know how you would go about designing something like this.
Meta Stack Exchange is a question and answer site for meta-discussion of the Stack Exchange family of Q&A websites. It only takes a minute to sign up.Sign up to join this community
There is a log stored in the database that keeps track of the days you visit the site (probably with some other information, too). I believe diamond mods have read-only access to the log data for each user account.
Once you have a set of data that represents the days you've visited, then it's trivial to derive statistics about that data set, such as the longest streak you've visited consecutively, or how many days you've visited in total.
In the case of this site, these derived statistics are most likely denormalized to a user account field for performance reasons. You may not necessarily have to go that far in your application.