# Total number of views - ROR

**URL:** <https://www.ruby-forum.com/t/total-number-of-views-ror/188800>\
**Category:** Rails\
**Created:** [May 18, 2010, 5:37pm UTC](https://www.ruby-forum.com/t/total-number-of-views-ror/188800 "2010-05-18T17:37:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ash](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f19dbf/32.png) [@ash](https://www.ruby-forum.com/u/ash)\
**Post date:** [May 18, 2010, 5:37pm UTC](https://www.ruby-forum.com/t/total-number-of-views-ror/188800/1 "2010-05-18T17:37:37Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ash](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f19dbf/32.png) [@ash](https://www.ruby-forum.com/u/ash)\
**Post date:** [May 18, 2010, 5:49pm UTC](https://www.ruby-forum.com/t/total-number-of-views-ror/188800/2 "2010-05-18T17:49:56Z")

</div>

Hi

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

---

<div class="post-metadata">

**Author:** ![ash](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f19dbf/32.png) [@ash](https://www.ruby-forum.com/u/ash)\
**Post date:** [May 18, 2010, 5:55pm UTC](https://www.ruby-forum.com/t/total-number-of-views-ror/188800/3 "2010-05-18T17:55:47Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ash](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f19dbf/32.png) [@ash](https://www.ruby-forum.com/u/ash)\
**Post date:** [May 18, 2010, 6:25pm UTC](https://www.ruby-forum.com/t/total-number-of-views-ror/188800/4 "2010-05-18T18:25:25Z")

</div>

Gregor P. 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](http://analytics.google.com)
