Total number of views - ROR

Hey

I want to implement functionality which would let me display total number of views for chosen pages.

I can create a table to have user_id and page_id for example to keep track of total views. but issue is if there are lot people hitting my page doing so many inserts in table would not be a good idea and could create lot of issues...

Is there any approach that i can use to solve this issue better. Are there any plugins available so far to show total number of views or hits on each page.

Regards Ash

Hi

Is this not something for Google Analytics or something similar to that?

I take it that you want this to be real time?

Maybe not a database but an in memory hash table like memcached, redis or tokyo cabinet. They have op codes to increment counters that would be atomic operations.

Gregor Panek wrote:

Hi

Is this not something for Google Analytics or something similar to that?

+1

Google Analytics is going to provide you so much more than you would ever want to implement yourself. Plus, it's dead simple to integrate into your application.

analytics.google.com