search

Home  >  Q&A  >  body text

mysql大表or小表?

facebook采取的设计原则是把表设计的竟可能小,但小表岂不是要频繁join,假如根据一张表中的数据再逐一去取另一表数据会导致mysql连接数飞起?

倘若用大表保持一定冗余性,这种情况对与facebook之类sns网站海量数据会不会导致很快进入瓶颈?

PHPzPHPz2780 days ago619

reply all(2)I'll reply

  • ringa_lee

    ringa_lee2017-04-17 11:41:01

    1. Of course, small tables are better, reducing IO and easy to expand (for example, when adding fields, there is no need to modify the main table)
    2. As for the join problem you mentioned, it does not exist, because Internet applications generally do not allow join operations. There are two reasons. One is the slow speed, and the other is that you will split the database and tables in the future. What should I do?
    3. What should I do if there is a need to join in business? --In-memory processing

    reply
    0
  • 大家讲道理

    大家讲道理2017-04-17 11:41:01

    Personally, I think it is more reliable to split it into small tables and join in memory.

    reply
    0
  • Cancelreply