Hacker News new | ask | show | jobs
by wlll 2994 days ago
Because MySQL is the PHP of databases. Much like PHP is designed to just carry on truckin' whatever problem it encounters (https://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/), MySQL was too. It's easy to slam some data into it and get it back without having to think too hard about what you're actually storing (https://grimoire.ca/mysql/choose-something-else). It's ease of use made it pervasive, much like PHP.

Following on from that, I suspect a lot of large companies use MySQL because they always have, not because it's actually any good. For example, Basecamp used MySQL while I was there, but I never met a single Sysadmin there who would use it over Postgres if they were to start a new project.

1 comments

PHP was built for the web and has been successful at that job. It is easy to use because the core developers have made some good design choices for the task at hand. For example no threads, stateless requests, core functionality focused on outputting HTML, etc.

MySql and PHP are good. They do the job they were designed for in a cost effective way and of course that means there will be trade offs.

PHP is crap. It's actively hard to write good code in it. Not good code like SOLID or pretty code that's self documenting, it's hard to write code that's not going to break in unique and interesting ways.

Sure, you can knock up a contact form in it really quickly, but that ease of use hides significant dangers.

I've programmed it, it's a terrible language.

This might have been true 10 years ago with versions like PHP 4. But remember many companies have invested a lot into PHP including Facebook. In the newest version of PHP what you said cannot apply with a type system, OOP features like traits, class inheritance etc.