Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: 降低浏览、点赞等高频操作对数据库的压力 #74

Open
Durancer opened this issue Aug 21, 2023 · 0 comments
Open

perf: 降低浏览、点赞等高频操作对数据库的压力 #74

Durancer opened this issue Aug 21, 2023 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@Durancer
Copy link
Owner

业务场景 & 需求分析
目前浏览、点赞等操作,将直接修改数据库的统计数据,如:一条帖子被浏览,将修改帖子的浏览量和用户收到的浏览量。有较多用户同时在线时,将对数据库造成一定的压力

解决方案
其实这并不是很急着修改数据库的操作,可以先将数据在 redis 中存储,使用定时任务刷新每日浏览量,并更新到数据库中。

@Durancer Durancer added the documentation Improvements or additions to documentation label Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant