Jump to content

Storing hits in the database?


random1

Recommended Posts

Hey All,

 

I have a MySQL database table currently recording a record each time a user visits the site (the date and time, the browser, OS, page they visited etc).

 

I can tell that this will become a very big table when many users hit the site. The ID for the table is currently bigint(255).

 

Is there a better data type I should use? Should I put in place an archiving system for this table since it's going to be so HUGE?

 

What's the best way to handle a table that you know will be full of data? ( > 15000 records)

Link to comment
Share on other sites

most servers and hosting providers already give this information. For my client, I'm more concerned about how many "visits" the site gets instead of each individual page view. So every time I get a new "visit"(basically, when a new session is created) I create a session variable and then on the next page hit, I check if the session variable has been created. if not, I add a database entry. if so, I don't. Of course, a user can just exit the window and revisit the site and it'll count as a new visit so I have a checker to see if xxx ip and yy browser have visited in the last zz seconds. I also validate ip's(make sure they're formatted correctly) bc ip spoofing can render my method useless

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.