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

为什么要分库分表 #94

Open
lovelmh13 opened this issue Jun 29, 2021 · 0 comments
Open

为什么要分库分表 #94

lovelmh13 opened this issue Jun 29, 2021 · 0 comments

Comments

@lovelmh13
Copy link
Owner

肯定是因为性能问题啦

但是具体有什么呢:

  1. 写入的性能。读的性能可以通过从库来解决,弄好多从库,但是主库只有那一个。那么写入的流量多的时候呢?我们知道通过分库,可以来分担写入时的压力。
  2. 数据量大 。只分表的话,肯定还是部署在同一台机器上,而分库了的话,就可以部署在不同的机器上,减轻机器的压力。

在分库分表的时候,可以按照垂直和水平来切分。

  • 垂直是按照业务来分
  • 水平是用过散列、取模等来分,要分 10 个,可以 n%10,按照余数来区分。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant