Forum .LRN Q&A: Re: New user tracking package

Collapse
Posted by Malte Sussdorff on
If I understand correctly you need to keep track of:
  • user_id (who has done an action)
  • package_id (where was the action done)
  • url (what was the action)
  • object_id (on what object was the action done)
  • date (when was the action done)
To improve performance you might want to add
  • community / class_id
  • package_type
I'm not entirely sure where you want to store this information for each request. But I'd suggest to keep it seperate from your main database. Either store it in a flat file (like you approach with appending values to the logged information in the logfile suggests) or use a different database with seperate database connections on a seperate server (read: data warehouse). The latter would allow you to make use of this information even if you are loadbalancing the system. Furthermore you could execute long queries on the second database without an impact on the main database serving the site.

As we are in the lucky position to have a smart AOLserver, you can actually start with the creation of a new database pool (call it e.g. "user_log") connecting to a seperate tablespace (or user with postgres), which does not require you to have yet another physical server for logging especially in the development phase, but allow you to make use of this seperation at a later stage when load is high.

At one point in time it might even make sense to dublicate some tables (e.g. users, groups), as this would prohibit you from having to call the real database if you want to get the user's name out of the user_id.

Collapse
Posted by David Ortega on
Hi Malte, thanks for your comments.

Our idea is to add user_id and community_id to each request stored in the logfiles. Awstats will use REGEXP to filter the URL and then to recognize objects visited, e.g. when a user wants to see a message of a forum, it can be identified by message-view?message_id=XXXXXX.

As first approach, we are going to use the data provided by awstats. This software, extracts the important information of logfiles, and stores it in formatted text or xml files.