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

[optimize] 大项目直播中提到的优化点 #41

Open
11 of 18 tasks
zhicheng-ning opened this issue Feb 17, 2023 · 0 comments
Open
11 of 18 tasks

[optimize] 大项目直播中提到的优化点 #41

zhicheng-ning opened this issue Feb 17, 2023 · 0 comments
Assignees

Comments

@zhicheng-ning
Copy link
Member

zhicheng-ning commented Feb 17, 2023

  • 功能实现方面

    • 参数校验
    • 考虑计数范围边界
    • 点赞功能(redis + rabbitmq,点赞异步更新)某个大 v 发了一个热门视频
    • 粉丝关注列表(低频大量数据)
    • 故障组件出现问题怎么办(服务降级,降低故障对用户的影响)
    • feed 流(添加推荐功能)
    • 好友列表 需要相互关注
    • 延迟双删(保证数据一致性)
  • 代码质量

    • 避免使用魔法值
    • 封装公共代码
  • 服务质量

    • 接口的请求性能(pprof)
    • 压测工具进行接口测试(jmeter,apifox)
    • 接口延迟方面(数据库优化,设计合理的索引,缓存优化)
  • 安全可靠

    • 用户注册登录(密码加密)
    • 用户注册(避免批量注册机器人)
    • 接收用户提交信息的接口(考虑 sql 注入,主要:参数化查询防止SQL注入,原理是采用了预编译的方法,先将SQL语句中可被客户端控制的参数集进行编译,生成对应的临时变量集,再使用对应的设置方法,为临时变量集里面的元素进行赋值,而QueryRow()方法会对传入参数进行强制类性检查和安全检查,所以就避免了SQL注入的产生)
    • 流量分析(避免爬虫爬取视频数据)
    • 点赞(避免刷赞,同一个用户同一个时间窗口内控制最多能点赞的数量)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

5 participants