多个数据库与单个数据库 [英] Multiple databases vs a single database

查看:161
本文介绍了多个数据库与单个数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在看一个现有的网站,他们正在使用单独的数据库。数据库的设置方式如下:




  • 一般类型(user_type,language,age等)

  • 会员数据(注册信息和登录)

  • 网站配置



<就个人而言,我会把一切都放到1个数据库中。对我来说,这几乎总是把数据库名称放在每个表的前面。



从安全角度看,我可以看到人们不能访问错误的数据,但在这个网站上将有管理员(大约10%的网站上的用户),将需要访问所有的数据库,进行跨数据库搜索。



做单独数据库的原因是什么? (网站位于PHP和MySQL中。)



编辑:db的名称是:




  • sitename (实际网站名称)(一般类型)

  • code>会员(会员数据)

  • siteconfig

解决方案

纯粹推测创作者心中的想法:



可能是数据的volitilaty的差异,所以对不同的物理dbs可能有不同的备份/复制策略?



也许例如,一般类型可以在多个应用程序之间共享,但是站点配置只针对一个应用程序?



也许一个想法不同的数据库可以放在具有不同性能特性的不同硬件上,例如它们的RAID配置。



再次,纯粹的猜测...



@ Darryl - 我的答案比科技更考古。我不是说我买任何它。我只是想进入祖先的心态...


I'm looking at an existing site and they are using separate databases. The databases seem to be setup in the following manner:

  • general types (user_type, language, age, etc)
  • member data (registration information & login)
  • site configuration

Personally, I would put everything into 1 database. To me this would make it easier than almost always having to put the database name in front of every table.

I can see from a security perspective ensuring that people cannot access the wrong data by accident, but on this site there are going to be admins (about 10% of the users on the site) that will need to access all the databases, doing cross database searches.

What could be the reasons for doing separate databases? (The site is in PHP & MySQL.)

Edit: The names of the db are:

  • sitename (the actual site name) (general types)
  • member (member data)
  • siteconfig (site configuration)

解决方案

Purely speculation on what was in the minds of the creators:

Maybe a difference in the volitilaty of the data, so that there could be a different backup/replication strategy for the different physical dbs?

Maybe an idea that say, "general types" could be shared across multiple applications but the "site configuration", for example, would be specific to just one application?

Maybe an idea that the different databases could be put on different pieces of hardware that have different performance characteristics, like their RAID configuration. Data that is read a lot but not updated versus data that is updated a lot.

Again, pure speculation...

@Darryl - my answer is more archeology than technology. I'm not saying I buy any of it. I'm just trying to step into the mindset of the ancestors...

这篇关于多个数据库与单个数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆