I use MySQL and absolutely hate it.
As far as I can tell, the main reasons people use MySQL are 1) it's well-known, well-documented, free, and widely available; shared hosting, for example, is almost always MySQL and 2) replication. I often wonder if the inadequacies of MySQL are part of the reason for the success of NoSQL databases and general un-hipness of relational databases.
I don't disagree there's tradeoffs - I mentioned replication, for example, but it seems to me that MySQL is lacking a lot of features that other DBMS's provide and except for a few use cases, the fewer features unique (or better implemented) in MySQL doesn't make up for it.
Honestly I prefer SQL Server by leaps-and-bounds over the four I've used enough to be very familiar with - MySQL, MS SQL, Oracle, and Postgres - but I think Postgres has much more to offer to most users for most use cases than MySQL.
I'm digging up some references now.
> As a final word – yeah, but why PostgreSQL doesn't handle it internally, as the other database?
> Answer lies somewhere between "developers have other things to do first" and "it's complicated, because there are many ways to do it, and the most correct one is slow – so there is a trade off decision to be made".
I'm not sure how upsert is implemented in MySql but given its reputation and the fact that it is open source; I would imagine the Postgres team has considered their solution and have decided it wasn't good enough for their standards.
Postgres may not have an out-of-the-box solution but there are solutions out there which are mostly pretty trivial functions. Although they may add a bit of bloat since it seems you'd need a function for each table you'd want to use upsert on.
Nearly the same experience, but much better is online in my opinion.
Exercise: Go to reddit.com/r/postgresql and reddit.com/r/mysql and see if there is any difference in topics.
- MySQL: 279,125
- PostgreSQL: 32,040
Github repository results
- MySQL: 16,476
- PostgreSQL: 4,332
It's not a dealbreaker, but I have to admit to feeling a tiny bit disappointed when I see Mysql instead of Postgresql.
In any event, I'm positive Mysql is actually more widely used. But Fiats are more widely used than Ferraris, too.
Ranking methodology: http://db-engines.com/en/ranking_definition
Google trends also shows MySQL above Postgres in popularity: http://www.google.com/trends/explore#q=%2Fm%2F05ynw%2C%20mys...
I mean, I use it at work, but that is because this project dates back to the late 1980s(!) and decisions were made 20+ years ago.
It doesn't even support a Boolean type(!), costs a ton (over 2x MS SQL, 4x Postgres), passwords are limited to 30 characters, up until 2007 passwords were case insensitive, error feedback is "basic," and the syntax is horrific.
Oh and don't get me started on how poorly Oracle maps to programming languages. number(9,0) and number(18,0) is not an intuitive way to map into int32 and int64!
Microsoft's bigint, int, smallint for 64, 32, 16 respectively is far more intuitive.
- Oracle have good name recognition (no one ever fired for using Oracle), presumably an army of support people, well trained consultants, etc.
- Postgres traditionally has not been as perforrmant, which makes it less useful for very large datasets.
- Furthermore Oracle perf can usually be improved further by hinting properly, which is not possible in Postgres. Certainly moving like-for-like onto postgres simply led to perf regressions.
I'm not an expert, but those were my main takeaways from talking to people who are.
If you're a F500 with your general ledger in Oracle, it's just easier to pay a few million dollars for a known evil than to spend who knows how much to replace it with a raft of potential difficulties during a migration project.
After working with it for a few years I hate Oracle as much as the next developer, but most of the time business decisions are made for business reasons, not technical reasons.
That said, SQL server is quite competitive. I still prefer Oracle to the others, I presume it's just a personal preference.
Postgres or MySQL are fine alternatives if you really only need a small subset of the features. Trouble is, most enterprises like to throw on the pork with most projects.
"favorite" != "popular"
I don't think the editorializing in the title is an accurate summary of the survey's results.
I actually liked working with XBase back in the 80s, but I don't miss not having foreign key constraints enforced, not having transactions, having long data values truncated, not being able to take a backup while running.
Early MySQL was too much like XBase for my taste, whereas PostgreSQL felt like a "real" database. I realize the InnoDB backend makes data integrity a bit more of a priority, but MySQL always felt like "worse is better", even if a bunch of "will code HTML for food" 90s internet crack heads helped make it ubiquitous. Windows is ubiquitous, and that doesn't mean much to me.
Galera cluster is an awesome multi-master solution and I've had nothing but excellent experience with it in production environments. We currently typically direct writes at a single node and spread reads in round-robin to all three nodes using an HAProxy front-end to the cluster, but there is nothing preventing us from spreading writes across the cluster if it was needed. If the current write node goes down there is only a couple seconds of interruption as a new write node is elected and the application reconnects. Furthermore, if a node goes down rejoining is completely automatic once it starts back up with no slowdown in reads and writes. I don't have near as much PostgreSQL experience but replication and failover have been serious pain points from an operations stand-point when I have had to use it. I appreciate the end-user features of PostgreSQL, but operationally MySQL/MariaDB (plus Galera cluster) are miles ahead of anything I've seen for PostgreSQL.
I am almost 100% certain PostgreSQL will have have stable master-master replication within 1.5 years. The team working on it has come really far along.
I'll admit I've never, ever wanted synchronous replication, so that's not a feature I've cared about.
I agree it will probably get there. But from my point of view it is still substantially lagging.
Example - http://blog.onetechnical.com/2012/05/29/quick-mysql-replicat...
You mean "intents and purposes".