How do I keep track of user actions on my website without killing the database?
April 8, 2008 1:44 PM   Subscribe

How do I keep track of user actions on my website without killing the database?

So I am thinking about trying to quantify some fairly fine grained tracking of user actions on my website. My first instinct is to put the numbers into a database. My second instinct is that it's going to kill the database to write to the database every time every user does something.

How do people usually deal with this? Is my 1st instinct wrong, and this is not really a problem? Other thoughts I had were that I could just log stuff to files. Another thought I had is I could put stuff in a memory cache and periodically dump to files or the database? Any other thoughts?
posted by realpseudonym to Computers & Internet (5 answers total) 1 user marked this as a favorite
 
How big is the site?

If you don't really get that much traffic, the database hit is going to be negligible anyway.

If you're talking about a significant size of traffic and you're on a dedicated machine and already pushing your limits, then memcache would be an alright choice (and dumping it later).

Keeping a separate log open and writing to that, then doing post-processing later on would work as well. Both are good ideas -- it's just a matter of "how big are you" and "what's the best use of my time"?
posted by jdgdotnet at 1:50 PM on April 8, 2008


Maybe see if Google Analytics can track what you want to track. all that data is exportable anyway.
posted by softlord at 2:47 PM on April 8, 2008


Depends how fine. If you're talking about mouse-movements, pauses, etc, then you probably want to either a) use Google Analytics or b) have the client save the data until there's enough to justify a DB query.

If you're just talking about page-clicks, sessions, and the like... you're probably fine to do it in a DB.
posted by toomuchpete at 3:48 PM on April 8, 2008


If google analytics won't do it (that was gong to be my suggestion, but softlord already responded), then how about putting the numbers into a database and having a nightly job that clears out the table and exports it in some format you can download/delete from?

It really depends upon what you're trying to track, though. A database might not even be the best solution regardless of performance concerns. Can you elaborate a bit?
posted by twiggy at 7:47 PM on April 8, 2008


Crazy Egg is pretty cool; even if it's not what you're looking for its fun to play with!
posted by cardamine at 2:46 PM on April 9, 2008


« Older Should I take on significant debt in pursuit of a...   |   What Would History Have Done? Newer »
This thread is closed to new comments.