search

Home  >  Q&A  >  body text

mysql - 一个拥有多个子站的网站数据库怎么设计好?

数据库该怎么设计?分开多个库还是一个库?

PHPzPHPz2821 days ago702

reply all(3)I'll reply

  • 伊谢尔伦

    伊谢尔伦2017-04-17 11:34:54

    1. Add siteId fields to all main tables, such as article table
    2. Basically no other data is called, so why bother considering this issue? Just treat each website as a library, and treat all these countless sub-sites as completely unrelated websites. In the end, When there is really a data call, write the interface directly

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-04-17 11:34:54

    There is an article on the Internet that specifically introduces how to expand Facebook. You are probably in the period of having a database now. The next step is probably to split tables, then to split databases, then to do clustering, and finally to synchronize across data centers.
    You can also try some Nosql databases, followed by hadoop distributed design and so on.

    reply
    0
  • PHP中文网

    PHP中文网2017-04-17 11:34:54

    At the beginning, it can be done in the same database and using separate tables.

    reply
    0
  • Cancelreply