I'm building a news website using Django and hope this website can handle millions of traffic.Now I'm coding a function that displays 48 hours most viewed articles to readers,so I need calculate the PV.
I have searched for a while and asked some people.I know I have some options:
1.using simply click_num=click_num+1,but I know this is the worst way.
2.A better way is using Celery to code a distributed task,but I don't know how to exactly do it.
3.I heard Redis also can used to calculate PV and UV but,have no idea how to do it and not sure the it can satisfy my needs.
4.Another good way is to use google analysis,but I also have no idea how to do it and not sure the it can satisfy my needs.
5.The last way ,I think the easiest way is to use JavaScript, but I'm not sure whether it can satisfy my needs.
Any friend can give me some advice? Thank you so much!