mysql - 一个拥有多个子站的网站数据库怎么设计好?
PHPz
PHPz 2017-04-17 11:32:54
0
3
682
  • 该网站主要以新闻、咨询为主。
  • 该网站无主站,子站通过二级域名访问,子站之间相对独立, 基本不调用其它站的数据。
  • 数据量较大,但基本是文章咨询类数据。
  • 对实时性要求不是很高
  • 基于mysql数据库

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

PHPz
PHPz

学习是最好的投资!

reply all(3)
伊谢尔伦
  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
伊谢尔伦

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.

洪涛

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template