Question
Statistics / Tracking
I am working on a project right now where I want to write a
small statistics / tracking component. I have an idea about how I
want to do it, but I figured I would throw it out there and gather
advise first so that I don't end up rewriting it in the end... It
is for a Content Management System project I am working on....
Basically I want to track sessions, their user if they authenticate, and what pages they look at so for both security and also for knowledge of how the site is being used for improvement as well as like a most popular page list and such...
I am currently using 3 different tables to accomplish this... instances (tracks application start and stop), sessions (tracks sessions and their associated info), requests (information about a request).
My main question is should I use an SQL statement to get the say top 5 pages based off of the records in the requests table or should I add a field to my pages table called say "hitCount" and then get that info from the pages table. I know that pages would be faster because it will have no where near the records of requests... but on the other hand there would then be twice as many SQL calls when a page is called because instead of just adding the record to requests, now it has to update hitCount in pages...
Has anyone else done this before? I am just looking for ideas, suggestions, advice, and such... and I always am able to find plenty of that here! Thanks for any and all help!
Josh Eby
Basically I want to track sessions, their user if they authenticate, and what pages they look at so for both security and also for knowledge of how the site is being used for improvement as well as like a most popular page list and such...
I am currently using 3 different tables to accomplish this... instances (tracks application start and stop), sessions (tracks sessions and their associated info), requests (information about a request).
My main question is should I use an SQL statement to get the say top 5 pages based off of the records in the requests table or should I add a field to my pages table called say "hitCount" and then get that info from the pages table. I know that pages would be faster because it will have no where near the records of requests... but on the other hand there would then be twice as many SQL calls when a page is called because instead of just adding the record to requests, now it has to update hitCount in pages...
Has anyone else done this before? I am just looking for ideas, suggestions, advice, and such... and I always am able to find plenty of that here! Thanks for any and all help!
Josh Eby