Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What's wrong with mysql?


Honestly, as others pointed out, the multitude of sins of omissions that MySQL has performed over the years. For example, its silently ignoring the foreign key constraints on certain database engines, such as MyISAM. On top of that, the repeated and continuing promises of actually implementing features like foreign keys in many of their database engines, including their high-performance NDB engine, means that the programmer has to do a lot more bookkeeping work on things that are built in on more rational databases.

The multiple database engine mess leads to its own problems compared to engines like postgresql. Do you use the InnoDB engine, and rely on third-party products, like galera, for clustering, or do you use NDB and suffer its weaknesses in referential integrity, and difficulty in configuration?

Finally, you get into issues where MySQL isn't nearly as featureful as PostgreSQL. For example, PostgreSQL supports a multitude of languages for creating server-side procedural functions -- pgsql, perl, python, tcl, etc, whereas MySQL only supports C, and only pre-compiled functions. This limits the utility, and leads to these quite useful features being left by the wayside because numerous coders were weaned on a database that didn't support doing these nice things for them.

While mysql does have certain uses, I'd argue severely that postgresql is a much better designed foundation for working on new projects. The attention to detail, the emphasis on not eating your data, and the level of features means that you can spend more time coding, and in the language you want to use, and less time fiddling with your database software.


Apparently, it isn't PostgreSQL; If you have no need for Postgres features and you're not familiar with it, sticking to MySQL is fine.


Well you can say the same for windows vs Linux or visual basic vs any other language, and you can also continue using paper glue to attach paintings on the wall.

It is not a matter of what you need, it is a matter of using good tools that will help you do good work, understand better what you do, build durable products, and so on.

Just one example: MySQL will not complain if you add a check constraint but will not actually add it to your schema. That's a very Microsoft-y way to handle things, and should give cold sweat to any coder.


This is actually documented behavior: "The CHECK clause is parsed but ignored by all storage engines." From: http://dev.mysql.com/doc/refman/5.5/en/create-table.html

I believe it was left to support certain migrations(?). You can create a trigger instead.

I'm pretty certain many people will consider MySQL a good tool with which they produce good work. While it may have its quirks, it's present on virtually all shared hosting environments, just like PHP, so it's very easy to create and deploy an application powered by both these technologies.


So, you are telling me that it is a good thing, a normal behavior for a reliable tool to just ignore instructions I send to it and do nothing with it, not even a warning? So when I migrate a database, I have to carefully check each and every instructions (schema and data) and make sure MySQL did not "decide" it was not worth it and just silently threw it by the window?

I have hard time to believe you are serious here...


I'm pretty certain when you migrate from a different database you're supposed to check your schema and data anyway, or do you just "decide" it should work without question?

I'm not saying this MySQL behavior is acceptable, I'm just saying that you should be aware of the limitations and quirks of the tools you work with.


So it's not acceptable behaviour, yet we shouldn't point it because we should know it has this unacceptable behaviour? Doesn't make any sense to me I'm afraid.


MySQL was a lot worse before 2004 or so. It wouldn't do transactions, nor proper joins, if I remember correctly.

I think the bad reputation still sticks to it.


I won't talk for the others but for me the "bad reputation" is not because of missing features, it is because of a wrong handling of ambiguous cases. If you ask a (SQL) question to a database and your question is ill-formed, ambiguous, or meaningless, it is very dangerous for the database engine to try to guess your meaning and answer something.

There are enough troubles with SQL (eg the Null debate) to add up to the mess by adding guesses.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: