How best to count views per page, per user, on a high traffic website? [closed] Code Answer

Hello Developer, Hope you guys are doing great. Today at Tutorial Guruji Official website, we are sharing the answer of How best to count views per page, per user, on a high traffic website? [closed] without wasting too much if your time.

The question is published on by Tutorial Guruji team.

I’m creating a website that will have articles, and it will support the ability for people to sign up as an affiliate (and get a subdomain) and get paid per ‘View’ that they send to the website (they typically post their links on facebook pages which drive the traffic to my site)

So a typical URL could be http://johnsmith.mydomain.com/post/an-interesting-article, where ‘johnsmith’ is an affiliates username. Now the problem I am seeking suggestions for is how to go about tracking the views on these articles per each ‘Username’. I have designed the below schema but I know it needs improvements, the site will initially get 30,000 to – 50,000 page views, so writing to a database every single time someone loads a page is completely unnecessary.

enter image description hereThe View part is definitely not set in stone, it is just an idea.

Basically I need to store which username sent how many views to a given page. One other thing also, I need to store the IP address because I won’t be paying for clicks that come from certain countries.

Using: MySQL, web server will either be Apache or xgnix

How best to go about this?

Answer

You could take a look at high-performance NoSQL database solutions for this problem.
Redis, for example, is a in-memory key-value store with very high performance. You can adjust persisting the records to the disk according to you needs.

We are here to answer your question about How best to count views per page, per user, on a high traffic website? [closed] - If you find the proper solution, please don't forgot to share this with your team members.

Related Posts

Tutorial Guruji