For example, Mercari counts the total number of views of each item, and you can refer to the items you have listed.
What comes to mind when the number of views is permanent is that each time you browse a product, you get the last number of views from the RDB, count it up, and save it to the RDB.
However, if you use this method with a large number of users like Mercari, you will get a lot of SQL per unit of time, which will cause performance problems.
In addition to the above methods, I would appreciate it if you could let me know if there are any other common ways to count the number of views.
sql
Depending on the environment, the options you can choose will change.
Assuming a typical LAMP environment,
NOSQL memcache
How about using it?
I will exclude browsing by the same user, so I don't think it will be possible to do it just by going up.
Maybe RDB would be fine.
In the first place, a large amount of SQL should always be issued whether it is viewed or accessed by logged-in users.
© 2024 OneMinuteCode. All rights reserved.