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

【mysql】数据库设计(表和字段角度) && 使用经验积累 (长期) #38

Open
yudidi opened this issue Jul 8, 2020 · 2 comments
Labels

Comments

@yudidi
Copy link
Member

yudidi commented Jul 8, 2020

主要内容

  1. 数据库设计
    主要从2个层次积累和总结数据库设计的一些实例以及基于这些实例得出的方法论。
    1.1 数据库设计(1)表的层面: 实体关系的处理 + 1个表还是多个表 + 分区表
    1.2 数据库设计(2)单个字段层面
  2. 数据库维护方面的经验积累和涉及的知识点
    2.1 大表清理

主要参考阿里巴巴开发手册和一份数据库设计规范

@yudidi
Copy link
Member Author

yudidi commented Jul 8, 2020

近期业务上用到了大表清理的问题。涉及该知识点。

  1. 每次删除1w条数据. => 单条单条处理性能太低。
  2. 大量删除数据过程中,binlog暴涨导致主从延迟增加 (TODO) 
  3. redo log和crash-safe, undo log

技术分享 | MySQL 碎片问题

@yudidi yudidi added the TODO label Jul 8, 2020
@yudidi yudidi changed the title mysql积累-(长期) mysql使用经验积累 && MySQL数据库设计规范-(长期) Jul 26, 2020
@yudidi yudidi changed the title mysql使用经验积累 && MySQL数据库设计规范-(长期) 【mysql】使用经验积累 && 数据库设计规范-(长期) Jul 26, 2020
@yudidi yudidi changed the title 【mysql】使用经验积累 && 数据库设计规范-(长期) 【mysql】数据库设计(表和字段角度) && 使用经验积累 (长期) Jul 26, 2020
@yudidi
Copy link
Member Author

yudidi commented Jul 26, 2020

防止数据库设计打补丁的方法是“三少原则”

  1. 表的个数越少越好
  2. 复合主键的字段个数越少越好
  3. 字段个数越少越好
    https://zhuanlan.zhihu.com/p/61123653

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant