oracle MySQL 与其他数据库的劣势

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1354451/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 18:53:55  来源:igfitidea点击:

Disadvantages of MySQL versus other databases

mysqldatabaseoracle

提问by Gordon Gustafson

Every single book that teaches programming (or almost anything else) starts off with a whole bunch of spiel on why what it's about (C++, MySQL, waterskiing, skydiving, dentistry, whatever) is the greatest thing in the world. So I open the MySQL O'Reilly book, and read the intro, and get the traditional sermon. The main points that the book mentionedwere:

每一本教编程(或几乎任何其他东西)的书都以一大堆关于为什么它的内容(C++、MySQL、滑水、跳伞、牙科等等)是世界上最伟大的东西开始。所以我打开 MySQL O'Reilly 的书,阅读介绍,并获得传统的布道。书中提到的要点是:

  • MySQL has been shown to have tied Oracle as the fastest and most scalable database software.
  • It's free and open source.
  • MySQL 已被证明与 Oracle 并驾齐驱,成为最快、最具可扩展性的数据库软件。
  • 它是免费和开源的。

Sounds pretty convincing, but I know there's always at least two sides of every story. I knew I needed to be disillusioned when I saw someone suggest to someone to use Oracle instead of MySQL and thought, "Why in the world would you want to do that?!", just because of the few paragraphs I'd read, with no other justification. So lets investigate the other side of the story:

听起来很有说服力,但我知道每个故事至少都有两个方面。当我看到有人建议某人使用 Oracle 而不是 MySQL 并想“你到底为什么要这样做?!”时,我知道我需要幻灭,只是因为我读过的几段,与没有其他理由。因此,让我们调查故事的另一面:

What are some reasons NOT to use MySQL?

不使用 MySQL 的一些原因是什么?

采纳答案by Eric

Here's just a random list of stuff that popped into my head. It's CW, so feel free to add to it as necessary.

这只是我脑海中出现的随机列表。它是 CW,因此请根据需要随意添加。

  1. Oracle provides a top notch ERP built on their database. If your company is subject to Sarbanes-Oxley regulations, this is quite a bit above "crucial."
  2. SQL Server licenses come with Analysis Services, Integration Services, and Reporting Services. If you want to do anything with OLAP, ETL, or reporting, these three are great applications that are built on the SQL Server stack.
  3. SQL Server has native .NET data types (in 2008). Absolutely brilliant for .NET shops dealing with geospatial datasets.
  4. MySQL does not support check constraints.
  5. SQL Server includes the overclause, which helps when dealing with the "top n rows in each group" problem. Essentially, you can do aggregate functions partitioned over the dataset any way you'd like.
  6. SQL Server uses Kerberos and Windows authentication natively. MySQL does not tie into Active Directory.
  7. Superior performance on subqueries (almost any database has subquery performance that is superior to MySQL's)
  8. Oracle, SQL Server, PostgreSQL and others have a richer set of join algorithms available to them; this means joins can often be performed faster, especially when large tables are involved.
  1. Oracle 提供了基于其数据库的一流 ERP。如果您的公司受 Sarbanes-Oxley 法规的约束,那么这远超“关键”。
  2. SQL Server 许可证随 Analysis Services、Integration Services 和 Reporting Services 一起提供。如果您想对 OLAP、ETL 或报告进行任何操作,这三个是构建在 SQL Server 堆栈上的出色应用程序。
  3. SQL Server 具有本机 .NET 数据类型(2008 年)。非常适合处理地理空间数据集的 .NET 商店。
  4. MySQL 不支持检查约束。
  5. SQL Server 包含该over子句,这有助于处理“每组中的前 n 行”问题。本质上,您可以按照您喜欢的任何方式在数据集上进行聚合函数的分区。
  6. SQL Server 本机使用 Kerberos 和 Windows 身份验证。MySQL 不绑定到 Active Directory。
  7. 卓越的子查询性能(几乎所有数据库的子查询性能都优于 MySQL)
  8. Oracle、SQL Server、PostgreSQL 等有一套更丰富的连接算法可供他们使用;这意味着通常可以更快地执行连接,尤其是在涉及大表时。

回答by Jeff Davis

MySQL has been shown to have tied oracle as the fastest and most scalable database software.

MySQL 已被证明与 oracle 并驾齐驱,成为最快和最具可扩展性的数据库软件。

Making that statement about any two database systems is probably enough to throw the book away without reading the rest. Database systems are not commodities that can be compared with a couple lines of information, and will not be for the foreseeable future.

对任何两个数据库系统做出这样的陈述可能足以让这本书扔掉而不阅读其余部分。数据库系统不是可以与几行信息相比的商品,在可预见的未来也不会。

One reason that the statement is obviously false is that MySQL has very limited plan choices available. For instance, MySQL can't use merge join or hash join -- two fundamental algorithms that have useful performance characteristics. That's pretty much the end of the story for many query workloads. It is trivial to show a reasonable query that is orders of magnitude faster with a merge join.

该声明明显错误的原因之一是 MySQL 的可用计划选择非常有限。例如,MySQL 不能使用合并连接或散列连接——这两种具有有用性能特征的基本算法。对于许多查询工作负载来说,这几乎是故事的结尾。显示一个合理的查询是微不足道的,它通过合并连接速度提高了几个数量级。

There are plenty of other criticisms of MySQL versus XYZ and vice-versa. My point is that this is a complex issue, and the book is drastically oversimplifying. If you're getting involved in databases at all, you need to spend time diversifying your knowledge and understanding fundamentals.

对于 MySQL 与 XYZ 以及反之亦然,还有很多其他的批评。我的观点是,这是一个复杂的问题,这本书过于简单化了。如果您完全涉足数据库,则需要花时间使您的知识多样化并理解基础知识。

My personal opinion is that MySQL and SQLite are the worst places to start. Pick something like Oracle (which can be downloaded free of charge for learning/evaluation, which many don't realize), PostgreSQL (BSD license), or MS SQL. FirebirdSQL might be good, too. Once you familiarize yourself with a few systems, you'll be able to make an informed choice about whether the trade-offs MySQL makes are right for you.

我个人的观点是 MySQL 和 SQLite 是最糟糕的起点。选择像 Oracle(可以免费下载用于学习/评估,很多人没有意识到)、PostgreSQL(BSD 许可)或 MS SQL 之类的东西。FirebirdSQL 也可能不错。一旦您熟悉了一些系统,您将能够就 MySQL 的权衡是否适合您做出明智的选择。

回答by EBGreen

Everyone seems to be missing one of the main reasons to stick with Oracle/MS. You've already got a stable full of DBAs that know those products inside and out.

每个人似乎都错过了坚持使用 Oracle/MS 的主要原因之一。您已经拥有一大批对这些产品了如指掌的 DBA。

回答by Thomaschaaf

The future is of sun (the company behind mysql) is unclear and you don't know whether there will be a company to back the product.

未来是sun(mysql背后的公司)不清楚,你不知道是否会有公司来支持这个产品。

回答by soulmerge

  • The default collation in mysql is case-insensitive.This is not a problem per se, but I think this strange default is an indication that it was targeted at hobby-developers, rather than professionals. This is a big assumption, but I'd think any professional would expect a database to compare strings for identity by default (i.e. using a binary collation).
  • Manipulation of tables during transactions causes implicit COMMITs.While this might not look grieve at the first glance, you will notice that you cannot cannot work under ACIDconditions if altering/creating tables is an inherent part of your application.
  • mysql 中的默认排序规则不区分大小写。这本身不是问题,但我认为这个奇怪的默认值表明它是针对业余爱好者而不是专业人士的。这是一个很大的假设,但我认为任何专业人士都希望数据库在默认情况下比较字符串的身份(即使用二进制排序规则)。
  • 事务期间对表的操作会导致隐式 COMMIT。虽然乍一看这可能并不令人难过,但您会注意到,ACID如果更改/创建表是您的应用程序的固有部分,您将无法在条件下工作。

回答by leeeroy

It's free and open source.

它是免费和开源的。

True. But keep in mind that MySQL is, in many cases, not free for commercial use. MySQL and the connectors (the official drivers for various languages), are GPL licensed.

真的。但请记住,在许多情况下,MySQL 不能免费用于商业用途。MySQL 和连接器(各种语言的官方驱动程序)是 GPL 许可的。

If you use, say, the Connector/.NET to connect to MySQL your code have to be GPL compatible. It's dual licensed though, so you can buy an enterprise version under another license - and I believe they have a (either free or just very cheap) program that lets you license the connectors under a different license.

如果您使用连接器/.NET 连接到 MySQL,则您的代码必须与 GPL 兼容。不过它是双重许可的,因此您可以在另一个许可下购买企业版 - 我相信他们有一个(免费或非常便宜的)程序,可以让您在不同的许可下许可连接器。

Everyone I know using MySQL is unaware of this :-)

我认识的每个使用 MySQL 的人都不知道这一点:-)

回答by Brent Baisley

MySQL can certainly match or beat Oracle in speed. I've done it numerous times myself. Ok, so I had to use various table types like black hole, merge, innodb, and myisam in just the right laces. And it took me a few days to get everything working just right. The Oracle DBA got things working in an hour or two.

MySQL 在速度上当然可以匹敌或击败 Oracle。我自己已经做过很多次了。好的,所以我不得不在正确的花边中使用各种表类型,例如 blackhole、merge、innodb 和 myisam。我花了几天时间才使一切正常。Oracle DBA 在一两个小时内完成工作。

MySQL is fine for 98% of the sites out there, maybe more. But it is fairly easy to bring it to a crawl without a lot of data if you don't know what you are doing. Oracle is quite a bit harder to bring to a crawl, but it can still be done. I've worked with both with datasets in the hundreds of millions of records (tiny by some measures). MySQL takes quite a bit more attention.

MySQL 适用于 98% 的网站,也许更多。但是,如果您不知道自己在做什么,那么在没有大量数据的情况下就可以很容易地对其进行爬行。Oracle 爬行要困难得多,但它仍然可以完成。我已经处理了数亿条记录中的数据集(从某些角度来看很小)。MySQL 需要更多的关注。

No database can scale indefinitely, which is why nosql "databases" are becoming so popular. I think the real question is if MySQL is "good enough" for what you need to do. The price is certainly right. The same could be said about PHP.

没有数据库可以无限扩展,这就是 nosql“数据库”变得如此流行的原因。我认为真正的问题是 MySQL 对于您需要做的事情是否“足够好”。价格当然是对的。PHP 也是如此。

Why does Facebook use MySQL? Could you imagine what it would cost them to buy enough Oracle licenses!? It's good enough.

为什么 Facebook 使用 MySQL?你能想象他们购买足够多的 Oracle 许可证需要花多少钱!?这已经足够了。

回答by Toto

Disclaimer: I have been using MySQL since 2001 and still love it, but here are a few reasons that make me doubt about my fidelity...

免责声明:自 2001 年以来我一直在使用 MySQL 并且仍然喜欢它,但这里有几个原因让我怀疑我的保真度......

There are some false arguments (it was true a few years ago) in some of the answers I read. Before making a choice, check MySQL documentation and its up-to-date list of features. You could be surprised.

在我读到的一些答案中有一些错误的论点(几年前确实如此)。在做出选择之前,请查看 MySQL 文档及其最新的功能列表。你可能会感到惊讶。

Each DB server lack functionalities. This is not a real blocking issue if you do not specifically need them.

每个数据库服务器都缺乏功能。如果您不是特别需要它们,这不是真正的阻塞问题。

For me, the main issues are elsewhere:

对我来说,主要问题在别处:

  1. The time needed to have a bug fixed and published in a stable release. It is a shame. (For some bugs... it takes years (no kidding)!)
  2. The frequency of stable releases.
  1. 在稳定版本中修复并发布错误所需的时间。这是一种耻辱。(对于一些错误......需要数年时间(不开玩笑)!)
  2. 稳定版本的频率。

But since this year, the new issues are:

但今年以来,新的问题是:

  1. The number of increasing branches (Percona, Google, Facebook, etc.).
  2. Sun is unclear with his strategy.
  3. Many MySQL employees left the company.
  1. 不断增加的分支(Percona、Google、Facebook 等)的数量。
  2. Sun 不清楚他的策略。
  3. 许多 MySQL 员工离开了公司。

回答by Rushyo

I knew I needed to be disillusioned when I saw someone suggest to someone to use oracle instead of MySQL and thought, "Why in the world would you want to do that?!"

当我看到有人建议某人使用 oracle 而不是 MySQL 并想,“你到底为什么要这样做?!”

Because your company has been using Oracle for the past ten years, or because you equate enterprise usage with 'must be good' and open-source with 'free crap'. That's just about the only reason. Everyone I know who has worked with Oracle loathes it. Everyone I know who has worked with MySQL, assuming they don't love it, at least consider it a better alternative to Oracle in almost every regard.

因为您的公司在过去十年中一直在使用 Oracle,或者因为您将企业使用等同于“必须很好”并将开源等同于“无用的废话”。这只是唯一的原因。我认识的在 Oracle 工作过的每个人都讨厌它。我认识的每个使用过 MySQL 的人,假设他们不喜欢它,至少在几乎所有方面都认为它是 Oracle 的更好替代品。

SQL RMDBs are so complex though, that in almost every respect there's something one DB does that another doesn't. It is also, unfortunately, a fact of comparing databases that people quote statistics without using properly configured servers. If you have two default configurations for a server, one might be better than the other, but that's about as far as the comparisons usually go. They don't reflect the fact that these gigantic applications have a million little switches and toggles you can use to speed certain things up, increase reliability and generally screw up bad science.

然而,SQL RMDB 非常复杂,几乎在每个方面都有一个 DB 做而另一个不做的事情。不幸的是,比较数据库的事实是人们在不使用正确配置的服务器的情况下引用统计数据。如果您有两个服务器的默认配置,一个可能比另一个更好,但这只是比较通常的情况。它们并没有反映出这样一个事实,即这些巨大的应用程序具有一百万个小开关和拨动开关,您可以使用它们来加快某些事情的速度、提高可靠性并通常会搞砸糟糕的科学。

回答by Crazy Joe Malloy

MySQL tends to be a very general purpose database system, you can use it for almost anything that you'd use Oracle, SQL Server, PostgreSQL, DB2, etc for.

MySQL 往往是一个非常通用的数据库系统,你可以将它用于几乎任何你使用 Oracle、SQL Server、PostgreSQL、DB2 等的东西。

However, these different systems have different strengths, PostgreSQL has a ton more functionality than MySQL and can handle some very specific tasks that MySQL struggles with. SQL Server usually integrates with Microsoft products very easily whereas MySQL you'd have to do some extra work to make them play together. Oracle is MASSIVE, they're not just databases and when you're dealing with large, expansive systems Oracle probably has the gear to cover everything under the 1 roof, whereas you'd need to tie a bunch of disparate systems together to have MySQL has your database system.

然而,这些不同的系统具有不同的优势,PostgreSQL 比 MySQL 具有更多的功能,并且可以处理 MySQL 难以处理的一些非常具体的任务。SQL Server 通常很容易与 Microsoft 产品集成,而 MySQL 您必须做一些额外的工作才能让它们一起玩。Oracle 是巨大的,它们不仅仅是数据库,当您处理大型、扩展的系统时,Oracle 可能有能力覆盖 1 个屋顶下的所有内容,而您需要将一堆不同的系统联系在一起才能拥有 MySQL有你的数据库系统。

Whether or not to use MySQL should be based upon whether or not it is reasonableto use MySQL.

是否使用 MySQL 应该基于使用 MySQL 是否合理