多台服务器使用单个 MySQL 数据库

发布于 2024-10-07 03:35:34 字数 446 浏览 2 评论 0原文

我想到一个大项目,它将占用服务器资源和带宽的大量负载。它应该与不同网页的巨大MySQL数据库一起工作(也许大约2000万条,我希望MySQL能够处理这样数量的记录)。但我认为我需要在多台服务器之间共享对数据库的请求,因为一台服务器无法处理这样的负载。我想知道像 Google 或 Archive.org 这样的大型项目是如何做到这一点的?我想到了原始方法,如下:

  1. MySQL数据库位于独立的独立服务器上。
  2. MySQL 数据库表包含一个字段,例如“服务器”,具有特定的服务器名称,记录将分配给该字段进行处理。
  3. 每个服务器都连接 MySQL 服务器,并且仅处理分配给该服务器的记录(通过查看该表中的“服务器”字段)。

我觉得这是一种菜鸟方法,但我想知道您的意见,也许您认为如何以更优化和更聪明的形式实现这一点。

会很高兴收到任何小费。

谢谢, 丹尼斯.

I think of a big project, which gonna take much load on sever resources and bandwidth. It should work with huge MySQL database of different webpages (maybe about 20 million, I hope MySQL can handle such amount of records). But I will need to share the requests to the database between several servers I think, because one single server won't be able to handle such a load. I wonder how big projects like Google or Archive.org are doing this? I thought of primitive method, which is like follows:

  1. The MySQL database is located on an independent standalone server.
  2. The MySQL database table contains a field, say, "server", with particular server name, for which the record is allocated for processing.
  3. Each server connects MySQL server and works ONLY with records, which are allocated to that server (by looking into "server" field in that table).

I feel like this is a noob method, but I would like to know your opinion, and maybe the ways you see how this can be implemented in more optimized and clever form.

Will be happy for any tip.

Thanks,
Dennis.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

怀中猫帐中妖 2024-10-14 03:35:34

(大概2000万左右,我希望MySQL
可以处理如此数量的记录)

20M 记录对于数据库来说几乎不算什么。这都是关于你如何使用数据库、如何编写 SQL、你的数据模型等等。不要担心 20M 记录,这根本不会有任何问题。

(maybe about 20 million, I hope MySQL
can handle such amount of records)

20M records is next to nothing for a database. It's all about how your use the database, how to write your SQL, your datamodel, etc. etc. Don't worry about 20M records, that's not going to be any problem at all.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文