I am running an ASP.NET MVC 3 web application and would like to gather statistics such as:
- How often is a specific product viewed
- Which search phrases typically return specific products in their result list
- How often (for specific products) does a search result convert to a view
I would like to aggregate this data and break it down:
- By product
- By product by week
- etc.
I'm wondering what are the cleanest and most efficient strategies for aggregating the data. I can think of a couple but I'm sure there are many more:
- Insert the data into a staging table, then run a job to aggregate the data and push it into permanent tables.
- Use a queuing system (MSMQ/Rhino/etc.) and create a service to aggregate this data before it ever gets pushed to the database.
My concerns are:
- I would like to limit the number of moving parts.
- I would like to reduce impact on the database. The fewer round trips and less extraneous data stored the better
- In certain scenarios (not listed) I would like the data to be somewhat close to real-time (accurate to the hour may be appropriate)
Does anyone have real world experience with this and if so which approach would you suggest and what are the positives and negatives? If there is a better solution that I am not thinking of I'd love ot hear it...
Thanks
JP