views:

1227

answers:

18

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 mentioned were

  • MySQL has been shown to have tied Oracle as the fastest and most scalable database software.
  • It's free and open source.

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:

What are some reasons NOT to use MySQL?

+4  A: 

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.

Thomaschaaf
MySQL is open source and used everywhere. Even if sun tanks (I doubt it), MySQL will be around and supported (by the community at least) for a long time.
Seth
@Seth: that would be sufficient for home and hobby use, but not for corporate use
Andomar
Very few large corporations will base their big money business app on 'community' support.
EBGreen
I think PostgreSQL is better than MySQL when it comes to large scale development
Learner
@Andomar - Corporate use implies a contract, which means that if Sun disappears, whoever buys Sun's assets will take on the contract.
Seth
Support contracts do not necessarily go with a purchase. Especially not after a bankruptcy. I don't think Sun going bankrupt anytime soon though. I think much more likely would be for Sun to simply stop supporting it since it is a competitor to Oracle.
EBGreen
Hmm ... I'd think it's pushing it to say that MySQL competes with Oracle. It's probably more accurate to say that Oracle competes with MySQL. Not for contract dollars, but for developers. Upcoming developers are more likely to be familiar with MySQL than others because the barrier to entry is so much lower. This is why there are now "Express" versions of Oracle, Sql Server, and even DB2.
Seth
So your implication is that Sun makes the same money for every corporate instance of MySQL that they do for every corporate instance of Oracle? I find that hard to believe. If that is not the case, then MySQL is most definitely reducing Sun revenue whenever it is used instead of Oracle. I would say that is competition.
EBGreen
Oracle is buying Sun: http://news.cnet.com/8301-13860_3-10314354-56.html Should put the "backing company question" in another light.
nawroth
Bought would be a better verb I think.
EBGreen
@nawroth: If they get bought the possibilty is there, that they might drop MySQL if it isn't worth it and that their plan is to ease the people into using oracle...
Thomaschaaf
A: 

My personal story:

Adding a new index to a table of about 10k rows.

MySQL side about 30 seconds.

Postgres side about 1 second.

Aaron Qian
To be fear, this is not something you do that often.
Kimble
What configurations?
Rushyo
It is quite often actually. Since most customers prefer release fast and release often. And usually optimization is put off in the pretty late stage.
Aaron Qian
Can you back these numbers up in any way? I just added an index to a 43k table in MySQL (on a fairly old machine). It took less than a second.
Wouter van Nifterick
That's odd, considering the size of the table. I'd say the problem is somewhere else.
JG
+2  A: 

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?!"

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.

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.

Rushyo
personally, I think the latest Oracle Express edition is quite fun to use. i love the admin interface.
djangofan
I can't speak for that. My totally anecdotal statements are based on corporate Oracle usage.
Rushyo
A bicycle is easier to use, maintain, and more fun to ride, than a train. The train engine uses coal, it's dirty, it breaks, it smells... But if you need too move a few metric tons from NY to SF, you would be insane to choose the bicycle (It totally scales! Just get more bicycles!)
SquareCog
Are you suggesting Flickr, Facebook, Wikipedia, Google and YouTube are the bicycle-riders of the database world?
Rushyo
I am suggesting that they use thousands of bicycles, and are very unhappy with that fact. Hence, Google's BigTable and MegaStore; Facebook's Cassandra and Hive. The way Flickr and Wikipedia (and FriendFeed) use MySQL, I contend they would do better using BerkeleyDB.
SquareCog
plus point for noting that you cant compare without understanding configuration.
djangofan
Oracle SQL Developer is a pretty awesome little app. Works with MySQL too though.
epalla
I've worked with SQL Server MySQL and Oracle. I too have come to loath Oracle. What a pathetic product! Check this link out absolutely hilarious -- http://forums.thedailywtf.com/forums/t/1142.aspx?PageIndex=1
James
+1  A: 

MySQL is free, but it takes an expert to maintain. Someone who naturally uses the command prompt and is not afraid to experiment. In some cases, MySQL problems are too complex, and the right people to troubleshoot them may not be available for any amount of money.

SQL Server is priced in the middle range. It can be maintained by "normal people", the kind who go home every day on 17:00 and have a natural disinclination to fifty page HOW-TO's. SQL Sever performs well in most instances but can break down in specific scenarios.

Oracle is the most expensive and requires highly paid operators. If you have the money, Oracle is a "safe" choice, because there's nothing Oracle won't do for money.

Three products, three markets!

Andomar
What about solutions like SQLite, PostgreSQL, etc. MySQL, SQL Server, and Oracle are not the only games in town. ;)
mipadi
That's interesting. I've always perceived and noted MySQL's usage as big in the unskilled hobbyist market, with SQL Server's insane insistence on T-SQL for otherwise basic tasks to preclude it for that purpose.
Rushyo
@Rushyo: Interesting comment, where I've seen MySQL in corporate environment, there were invariably some Linux-on-the-laptop types to keep it running. And the one system at my workplace that works well is written mostly in T-SQL, so I consider that one of Sql Servers strongest points!
Andomar
"linux-on-the-laptop types" -- do you mean programmers? ;-)(sent from my Ubuntu Laptop)
SquareCog
@Andomar: Both of which statements are utilising different contexts to the ones I was using. Apples and oranges argument.
Rushyo
plus point for noting that the choice depends on the use.
djangofan
A: 

Also, if you don't have to use RDBMS, checkout redis. It is basically memchached with persistence with asynchronous write through. The performance is not on the same scale with MySQL.

Well... I guess the comparison isn't really fair to MySQL since it's not RDBMS...

Aaron Qian
Just one more downvote and you can get a badge.... not .... gonna ... do it.
Emtucifor
+4  A: 

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.

EBGreen
A: 

I've worked with MySQL for years, and SQL Server only over the past year. I don't really see one being any easier or harder to use than the other in most cases. I do wish, however, that MSSQL had some of the features that MySQL possesses (e.g. being able to insert multiple rows on a single INSERT statement).

Secret Agent Man
Sql Server 2008: INSERT INTO table1 (col1, col2) VALUES ('First',1),('Second',2), ...
Andomar
I could've sworn that I received errors when attempting this syntax. My mistake.
Secret Agent Man
Prior to SS2008: `INSERT INTO tbl (col1, col2) select 1, 2 union all select 3, 4 union all select 5, 6`
Eric
+18  A: 

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.

  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 over clause, 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.
Eric
+1 This is the list I was hoping someone would have provided. Add to it that I can code directly in SQL Server with C# and do just about anything I want not already provided by the database provider. This is the added power that any .net developer craves!
Andrew Siemer
Very good list but with a few glaring inaccuracies. Some of these assume using MyISAM, others InnoDB and none of those seem to adequately account for the other database formats.
Rushyo
@Rushyo: Care to be not so cryptic or fix the "glaring inaccuracies"?
Eric
I'd trade over for limit any day. :)
epalla
@epalla: You need to go read up on OVER. LIMIT does make it easier to select a range of rows, but it has no aggregation, grouping, or ordering capacity, which makes it far inferior. Nor can it inject values into the recordset. OVER can be used with Row_Number, Rank, Dense_Rank, NTile, Sum, Max, Min, and Avg... sorry, LIMIT isn't even in the same universe as OVER.
Emtucifor
@Emtucifor: Yeah, I've never actually used Over so I was just going off the 'partition aggregate functions over the dataset' description. I guess I shouldn't have compared the two. Mostly I'm annoyed that Oracle/SQL Server don't have something as simple as Limit. I guess it sounds like Over could probably accomplish the same thing for SQL Server, but Oracle still flounders like a retard by comparison if you want to say "just give me rows 100-200".
epalla
I agree the "TOP (x)" syntax in SQL Server could really use a second operand indicating which row to start with!
Emtucifor
+1  A: 

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.

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.

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

Crazy Joe Malloy
+2  A: 
  • 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 ACID conditions if altering/creating tables is an inherent part of your application.
soulmerge
Oracle DDL operations themselves are not embarcked in transactions. Both MySQL and Oracle systems are broken. MySQL behavior is much worse. MSSQL has it right in terms of transactional DDL.
Einstein
The default collation on MS Sql Server is case insensitive, too. I don't think that's a big point in any direction, seeing as it can be changed.
Emtucifor
A: 

Basically, there are several choices for a database. Frankly, in today's world, DB choice is less important than it was a few years ago. Here are a few issues to consider.

  1. Most of the current database systems in widespread use such as SQL Server (and SQL Server Express), Oracle, MySQL, SQLLite, etc. are relatively standards compliant and can be used somewhat interchangeably. Some serve different niche markets. For example, SQL Server, MySQL, and Oracle are all good choices for large Enterprise applications. SQLLite is very good for applications which deploy on a client and need a local database with a small footprint and minimal configuration. (In my opinion, Oracle is extremely over-priced, is backed by an arrogant unresponsive company. It would never be my first choice on any project. I would only use it if it was mandated by the client or by necessity.)

  2. A high percentage of top-end developers are using tools such as Hibernate(Java)/NHibernate(.NET) to build their data access layers. Hibernate variants strongly encourage developers to start with development of the object model rather than the database model. The Hibernate application then generates the data model automatically--and even handles data model updates. Hibernate variants can be used with any of the major database vendors. Changing your database choice can be as simple and painless as selecting a different database type in your configuration. On a side note, I should mention that while Hibernate and NHibernate are cross-database-compatible, they do not work on the lowest common denominator. The data access code in these applications is often designed to take advantages of special features within a given database engine. For example NHibernate supports access to the NVarchar(Max) data type in SQL Server which allows for very long strings.

  3. In most applications, issues with database performance do not derive directly from the speed of reads and writes. Most of the issues relate to how the application manages the caching of frequently accessed data. For example, in online blog site, it makes sense to cache blog posts once they have been read so they are not repeatedly fetched from the database. This caching mechanism is almost always primarily handled by the application code rather than database server--though database servers do provide some caching. Hibernate/NHibernate have excellent caching support built in as does Microsoft's ASP.NET and their new MVC framework built on top of ASP.NET.

  4. Enterpise databases (SQL Server, Oracle, MySQL) are best for situations where functionality such as replication, clustering, huge datasets, etc. are required.

A: 

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...

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.

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.

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.
Toto
+10  A: 

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

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.

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.

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.

Jeff Davis
A: 

A couple of pages listing gotchas (such as this and this) make me want to stay as far away from MySQL as possible. Here's a more neutral comparison of Postgres and MySQL.

As for the open source aspect others mentioned: MySQL is open source and free, only if your application is, too. If it's not, you need a commercial license.

devio
+1  A: 

I don't like MySQL licence : Firebird and PostgreSQL are better

There is no real hotbackup include in the MySQL by Sun

you can also look here which is interresting link and comment !

Hugues Van Landeghem
+1  A: 

MySQL is very tolerant of ambiguities -- something you don't want in a database system. Here are a few examples off the top of my head:

  • As another poster stated, CHAR and VARCHAR columns are case-insensitive, already a pretty bad sign.
  • You can INSERT into a table that has a column without a default value that is also NOT NULL. Yes, really! Instead of throwing an error, MySQL will pick a value for you based on the data type, e.g. 0 for numbers.
  • You can use a GROUP BY statement while some columns are neither using an aggregate function, nor included in the GROUP BY statement. The outcome is pretty much random. No warnings or errors here either, in my experience.

MySQL is also far from rock-solid. Just this month, I discovered a bug in the (admittedly old, but a "stable release") version of MySQL used by DreamHost that results in data loss. (Certain conditions when creating a table with variable-length rows.)

I've been using MySQL for many years and still do, but would never dream of using it for anything serious, where data loss would be a big problem. It's great for non-mission-critical web sites and blogs though.

i-g
A: 
•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.

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.

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

leeeroy
+1  A: 

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 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.

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.

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

Brent Baisley