Choose which way to calculate the PV and UV in Django?

谁都会走 提交于 2019-12-02 08:54:38

问题


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!

来源:https://stackoverflow.com/questions/50278241/choose-which-way-to-calculate-the-pv-and-uv-in-django

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!