与其他 DBMS 相比,MySQL 是否消耗更多资源?

发布于 2024-12-09 13:21:07 字数 480 浏览 0 评论 0原文

从 mysql 转向 NOSQL、SQLite 等的趋势越来越明显。我读过很多博客和文章,比较 mysql 与其他类型的 DBMS 的速度。不过,我相信mysql的速度不是问题,因为它真的很快;但问题更多地与资源使用有关。由于 mysql 查询速度慢,经常会面临极端的服务器负载。例如,Oracle 相对于 mysql 的一个优点是与内存泄漏相关的问题较少。

  1. 与其他数据库(例如 SQLite、非关系数据库、键/值数据库)相比,mysql 消耗的资源(CPU 和内存)明显多得多,这是真的吗?我所说的显着是指大型数据库不使用mysql(以节省服务器成本)的主要原因。

  2. 如果是(到 1),与 Mysql 相比,类似系统(如 SQLite)的更好的资源使用估计是多少。

    如果是(到 1),对类似系统(例如 SQLite)

注意:考虑一个简单的系统,因为不需要 mysql 的高级功能。只是比较简单查询的性能。

There is a growing tendency for shifting from mysql to NOSQL, SQLite, etc. I have read many blogs and articles comparing the speed of mysql with other types of DBMS. However, I believe that speed is not a problem with mysql, as it is really fast; but the problem is more connected with resource usage. It is common to face extreme server load due to mysql slow queries. For instance, an advantage of Oracle over mysql is to have less problem associated with memory leaks.

  1. Is it true that mysql consumes significantly more resources (CPU and memory) comparing with other databases such as SQLite, Non-relational databases, key/value databases. By significantly I mean is it the main reason for not using mysql for large databases (to save server costs).

  2. If YES (to 1), what can be an estimate of better resource usage of a similar system like SQLite comparing with Mysql.

Note: Consider a simple system as advanced features of mysql is not needed. Just comparing the performance for simple queries.

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

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

发布评论

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

评论(2

吻泪 2024-12-16 13:21:07

如果您只使用“简单”查询,我认为 MySQL 和 Oracle 等资源使用情况没有太大区别。
那些“专业”的 DBMS 在缓存、预取和数据维护方面发挥了很多“魔力”。
当然 MySQL 也能做到这一点,但对于真正复杂的数据库和高级查询来说,它可能效率不高。

您对 DBMS 的选择很大程度上取决于您计划执行的操作,尤其是当您在 SQL/NoSQL/Key-Value/... 之间进行选择时,它们适用于完全不同的场景...这不是这是内存和CPU使用率的问题。

If you're only using "simple" queries, I don't think there's much of a difference regarding ressource usage between MySQL and e.g. Oracle.
Those "professional" DBMS do a lot of "magic" regarding caching, prefetching and data maintanance.
Of course MySQL does that as well, but it might not be as efficient for really complex databases and advanced queries.

Your choise of DBMS highly depends on what you're planning to do, especially if you're choosing between SQL/NoSQL/Key-Value/..., which are for completely different scenarios… that's not so much a question of memory and CPU usage.

孤独难免 2024-12-16 13:21:07

CPU 和内存从来都不是原因,因为它们很便宜。问题在于 I/O 速度。 NoSQL 数据库用于写入密集型应用程序,以及需要无模式数据库的应用程序(因为更改 MySQL 中的表模式涉及重写表,这可能非常慢)。因此需要进行一些权衡来优化磁盘操作,这通常会导致消耗更多的 CPU、内存或磁盘空间。

另一个原因可能是悲观锁与乐观锁。这是另一个话题了。

但由于“与其他数据库相比,mysql 是否消耗更多的资源(CPU 和内存)”这个问题的答案是,因此进一步讨论它是没有意义的:)

CPU and Memory never are the reason, as they are cheap. The problem is with the I/O speed. NoSQL databases are used in write-intensive applications, as well as in applications which need schema-less database (because changing the table schema in MySQL involves rewriting the table, which may be extremely slow). So some trade-offs are made to optimize the disk operations, which often lead to consuming more CPU, memory or disk space.

Another reason could be pessimistic vs optimistic locks. Which is another topic.

But since the answer to the question "Is it true that mysql consumes significantly more resources (CPU and memory) comparing with other databases" is NO, it is pointless to discuss it further :)

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