How to solve the statistics of the number of likes in the Chinese chapter of the website?

was originally intended to use redis"s HyperLogLog for statistics, but since users only have one chance to like each article, it is impossible to keep playing redis to determine whether users have liked it or not. But the efficiency of using mysql is too low. I don"t know if you have any good idea-sharp-sharp-sharp problem description

Oct.16,2021

be reasonable, why do you say mysql is inefficient?
giving likes is a very, very simple operation. And for the client, the real-time requirement of the data is very low.

  • the user opens the article and queries the database whether he / she has been liked and the current number of likes.
  • the number of likes that users want to see after giving likes is + 1. This is realized immediately through the front end, regardless of whether it is actually successful or not. Send it asynchronously to the backend, and cancel likes in the same way

these two points determine that the performance and efficiency requirements of the like system are basically equal to no requirements. It can even be said that as long as the system completes the database update of the like behavior within 10 seconds, the vast majority of users will not feel the impact on the experience.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3a9c4-2c21e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3a9c4-2c21e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?