Sunday, 25 August 2013

How best to store web hit counter data

How best to store web hit counter data

I have a web hit counter script that currently runs fine. The counter
store its data on a .txt file on public_html and creates a new file for
every month so as to differentiate the number of visits per month in each
year (e.g 8-13.txt), where 8 in August and 13 is 2013.
I am thinking of using a database to store the web hit record but am also
thinking the records to be stored will be much and might cause database
problem because the pages on the site where the web counter will be
implemented will be more than 500. Then there is this problem of creating
a .txt files all over the places.
I can write a script to store the web hit counter data in a database but I
am not clearly sure if it is the best. My question is, if I store these
data on the database, won't it hinder performance when some pages can be
visited more than 3000+ times per month?
Criticism, Ideas are appreciated.

No comments:

Post a Comment