0

how implement an efficient visits counter per page? I've marketplace platform, but not a visits counter per product page, then, this is my question. what's is the better algorithm for implement this?

I not think that this alghoritm is the better "update product set product.visits = (product.visits + 1) where ..."

then, how?

I'm accept sugestions

Google Analytics? third party solutions? Alghoritm?

thanks everyone

Was developed in Django

Thiago Freitas
  • 399
  • 1
  • 4
  • 5
  • Does this thread help? https://stackoverflow.com/questions/1603340/track-the-number-of-page-views-or-hits-of-an-object – user3750325 Sep 11 '19 at 18:21

1 Answers1

0

"Visits counters" can really hammer a page because a page can be accessed so many times (per second). Also, they tend to over-state the desired result for the same basic reason. (Your database load sails through the rafters ...)

I've had the most success using post-processing of the server access logs. (Of course there are plenty of existing tools.) You'll find that you want to filter this raw data to pick out what's the most "business meaningful" result for your particular case.

Mike Robinson
  • 8,490
  • 5
  • 28
  • 41