Obviously, there are third-party statistics services (Google Analytics, Mint, etc.), but if you have to do it yourself, then recording every time someone lands on the page will seriously affect your database.
I would write individual hits of the intermediate file in the file system or memcached, and then run a task every 10-15 minutes, which will analyze this data and insert it into the database.
Codebeef
source share