如何保存一个巨大的数据库表
想知道facebook等网站如何将其数据保存在MySQL数据库中。我最想知道的是:比如说,如果你有一个 userID 表(太大而无法保存在一台服务器中),你如何将数据分区并保存到不同的服务器中?即使所有的用户ID可能都保存在一台服务器中,用户的好友列表肯定不能保存在一台服务器中。那么,如果需要查询需要多个服务器的数据,该怎么查询呢?据我所知,mysql集群或memcached等只会对负载平衡或加速查询有帮助,但对于我提到的确切问题,我不知道它是如何工作的。
任何人都可以提供一些有关此的信息吗?链接或技术关键字也可能有帮助。
would like to know how the website like facebook etc.. saved its data in MySQL database. The most interested thing I would like to know is: say, if you have a userID table (which is too large to save in one server), how could you partition the data and save into different servers? even all userID might be saved in one server, user's friendlist definitely can not be saved in one server. Then, if you need a query which needs the data from several servers, how to do the query? So far as I know, mysql cluster or memcached etc.. will only be helpful for load balance or speed up the query, but for the exact problems I mentioned, I have no idea how it works.
Anyone could provide some info about this? links or technique keywords might be helpful as well.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这就是所谓的分片。这是信息
http://en.wikipedia.org/wiki/Shard_%28database_architecture%29< /a>
其他解决方案是也不使用 MySQL。有 NoSQL 解决方案,mongodb 可以为您进行分片。
Its called sharding. Here is info
http://en.wikipedia.org/wiki/Shard_%28database_architecture%29
Other solution is to also not use MySQL. There are NoSQL solutions, mongodb which might do the sharding for you.