I want to create a counter, daily, weekly and all time. Each product in my database will have a weekly, daily and all_time counters. MY goal is to be able to mimic a cronjob. I want to hear if this is the right way to do it.Let's assume that I will target only the daily counter. In my database in product's table I will have a a row called 'daily_counter'. For each product it will be initialized to zero. Another table will have only one row called \[code\]'for_Day'\[/code\] that holds that day for which the daily counters applies to.I will also initialize an application variable that corresponds to table with the one row and read the value from 'for_day' into an \[code\]Application["for_day"]\[/code\] variable. This will happen only when the application first starts.For each view of the product page of each user, I will do the following (using C#)Get the current day number\[code\]Int current_day = DateTime.Now.Day;\[/code\]Compare the current day to what's in the Application["for_day"]\[code\]if(current_day == Application["for_day"]){ // same day from last counter reset // do nothing}\[/code\]Do nothing if they are equal.\[code\]else if(current_day > Application["for_day"]){ // new day 1. Reset the daily counter in the database to zero 2. Application["for_day"] = current_day; 3. Update the column for_day in the database to current_day}\[/code\]I do this check for each user that visit my website. This should run once per day only and reset the daily counter in the database to 0 for the first user that visits the site the other day. Even if the first user comes two days after, it will still should work ok because it will update the data accordingly and all users will see the new counter for the current day.I thought that this is preferable to a cronjob, and I query the database only at application_Start and only once per day at most. My solution should work when launching my web app on multiple servers in load balancer. Because the database is on remote locaiton and doesn't resist on each server, I think this should work fine.I want your opinions about this technique, whether it will work as I expect it to work and whether there is a way to improve it. I prefer this because I do not rely on external cronjob services/servers, everything is in my application.I am developing my application in ASP.NET & C# and will install it on Windows 2008 servers and it will run behind a load balancers, probably Amazon AWS ElasticBeans.Thanks