I love PostgreSQL, regardless of the version as far as it's >= 8. Super efficient and reliable RDBMS yet less "enterprise" that Oracle. I always wondered why MySQL gained more popularity.
We had 6 months of testing a high-throughput database trying to get it to do the consistency and latency required for peak load to no avail. (Even to the point of replacing the kernel with a custom one, and using a faster memory allocator)
PostgreSQL could do it with only minor configuration tweaks.
It still took a further 1.5 years to get the central IT body of my company to allow us to use it, and we wouldn't have had that if our software didn't 100% require it.. I hate to imagine how other software that actually needs conversion is right now.
sidenote: I've had many corruption issues from using MySQL, so I'm double-baffled.
the consistency issues come from the handling of those filesystems by the control interface above it.
I'm fairly certain innodb by itself is pretty decent, in fact you can configure away the horrible behaviour nowadays, but I'm usually called in when things go wrong- and people usually keep the defaults.
MySQL's replication story has been mature for substantially longer than Postgres's. ~10 years ago, most of today's biggest social networks and other high-volume OLTP sites were starting to scale. Replication is essential and there was really no contest at the time. (EDIT to add specifics: pg added built-in replication in 9.0, released only 6 years ago.)
Today the majority of the largest sites on the internet use MySQL either as their primary database layer or at least as an essential storage system: Facebook, Google, Twitter, LinkedIn, DropBox, Alibaba, YouTube, WordPress.com, Wikipedia, GitHub, Yahoo, Yelp, Pinterest, Etsy, Tumblr, Flickr, Uber, Box, Booking.com... and meanwhile I keep hearing about more moving from pg to mysql partially or entirely (Instagram, Lyft, etc)
The result is that the MySQL ecosystem is huge. There are multiple distributions/branches, many third-party tools, expert consulting companies, knowledgeable people to hire. If you're scaling a high-volume OLTP site/app/product MySQL is a very reasonable choice.
Postgres is a great database, and is a better choice than MySQL for many applications. But some people like to think it's strictly better than MySQL in absolutely every way and every conceivable situation -- this is demonstrably not the case.
MySQL's replication is not mature. There are too many edge cases / pitfalls where it doesn't replicate to slaves. It requires you to monitor for these situations and build systems to work around it. I don't know why anyone thinks this is OK.
Postgres is late to the replication game but they have worked hard to make sure that replication doesn't have surprises.
The character set is another nightmare that surprises novice MySQL admins... and then the fact that it allows schema operations to destroy data by default...
Can you cite examples in recent versions? In my experience, the defaults in recent versions (mixed or row-based replication, strict sql mode) are quite sane and prevent most historic problems.
I don't have enough pg experience to make a valid comparison, but I have worked extensively on the largest mysql environment in the world (among many others), and can say that properly-configured mysql replication does not encounter the problems you are describing.
Yes, there are a lot of pitfalls for novice admins to avoid. That's true of all databases to some degree. MySQL may well have more pitfalls than others, but it also has a much wider net of experts who can help you avoid these pitfalls.
Anyway, by "mature" I was also referring to the sheer number of solutions offered, most of which are now battle-tested by many large users. Out-of-the-box in the latest version you get 2 types of logical replication (and a third type mixing the two), 3 options for level of synchronicity (async, semi-sync, and now sync via the new group replication), bidirectional replication, and multi-source replication. And there are additional third-party solutions for other synchronous replication setups (e.g. Galera), and even physical replication has been implemented internally by both Amazon and Alibaba.
I used to hit issues with replication and IF EXISTS and it was a nightmare: http://bugs.mysql.com/bug.php?id=77684 ... glad to see they (allegedly) fixed it
edit: I don't have anywhere near the experience you do with MySQL, but the odds of the average web developer / sysadmin configuring it properly is unlikely. The advantage of Postgres is that it protects your data first and there are much fewer foot-shooting options.
First link: Floating point values replicate fine. The manual says you may have problems if your master and replica are running different computer architectures, or were built using different compilers (and you're compiling MySQL yourself from source). Both situations are exceedingly rare.
Second link: Despite the admittedly scary wording, these things only impact two scenarios: either you're using MyISAM, and/or you're using MySQL 5.7's new LOGICAL_CLOCK multi-threaded replication but with a vital safety option disabled. Multi-threaded replication is not enabled by default anyway, and only users with extremely high write rates will ever need it.
Third link: these are all edge-cases relating to statement-based replication, which is no longer the default binlog format as of MySQL 5.7. Even with statement-based replication, these are rare; in 13 years of working with MySQL I've personally never encountered any of these specific issues.
Overall: I sort of get your point, yes there's a lot of knobs. But none of the things you've mentioned affect 99.9% of people running MySQL in the first place. MySQL replication works quite well out of the box, but provides a lot of options for advanced users to handle special cases. If you play with those options without knowing what you're doing, yes, you'll shoot yourself in the foot. That's true of most complex computing infrastructure.
The defaults in MySQL used to suck. They don't anymore, and haven't for a while.
I've been a Postgres fan since the mid '90s, but I'm gonna have to agree here. There have been tons of Postgres replication systems out there, for a very long time, but in my investigations I never could find one that I liked more than using DRBD and heartbeat. So that's what I did, and it worked well enough.
The MySQL replication felt much more integrated and there was one obvious choice and it worked fine for the uses I've had.
Did you have to monitor it and sometimes re-replicate it? Yes. Would I have put a replication system in place without monitoring it? No. And these weren't toy systems, one of the environments I used to manage you've probably used if you are in the US (several clients advertised on various superbowls, for example of scale).
I always wanted Postgres replication that was easy and well integrated like MySQL.
Today I think the replication story in Postgres is much better, but I haven't tried it recently.
So is MySQL's though. I LOVE MySQL Galera so far, though I've only used it for low volume stuff. Multi-master, just works, has been super reliable for over a year, but for a very low volume application. The only hitch has been when all nodes go down, you have to manually find the most up to date and start it in bootstrap mode. I wish they could just come up and realize all the nodes are in the cluster and negotiate who is newest automatically. But, it is a small workflow to manually handle it.
In any case, either of these replication systems are better than MS-SQL. Not for technical reasons that I know of, it is simply cost concerns.
Mature to me means having a wide feature set, and a history of successfully working at varying scale and workloads.
A lot of people like to bash MySQL, but without citing specific examples, or by referring to problems that haven't been true in a decade or more.
I've listed a large number of huge corporations that have had great success with MySQL, and have decided to stay on MySQL despite having the resources to migrate away if they saw a compelling reason. Some of the companies on that list are relatively new, yet still chose to start with MySQL, or migrate to MySQL after scaling.
If MySQL is as flawed as people in this thread insist, why are so many companies continuing to use it and even migrating to it? In a few cases I can provide a first-hand answer, and maturity and ecosystem are two of the biggest factors.
I believe this is quite easily explained and at the risk of repeating other information in the thread.
1) Why are large companies still using mysql: "We can deal with the pain", Facebook turning mysql into a dumb k/v store is not equivalent to using it's feature set. Nor is it a resounding recommendation.
2) Why are new companies using mysql: Everyone knows mysql, people don't know the problems they will have until it's either too late or MySQL performs decent enough for now.. Many people haven't even heard of PostgreSQL or think of it as foreign and strange and don't wish to reeducate.
People bash on MySQL because like PHP it's architecturally bad and things are being solved at a glacial pace, it's defaults are still absurd, it's handling of character types is absolutely insane unless you know precisely what you're doing and it's absolutely full of inconsistent and often counter-intuitive behaviour.
examples: error in constraint commits data anyway[0], just clobbering your database. UTF8 isn't actually UTF8 it's only three bytes wide, so you need utf8mb4[1].
Facebook doesn't use MySQL as a dumb k/v store. This is simply incorrect.
Although for primary product data (status updates, friends, likes, etc) the access pattern is restricted via a data access layer, it's supporting a distributed graph model (nodes and edges, distributed across many shards). Far more features than a "dumb k/v store".
Separately, Facebook uses MySQL for countless other critical OLTP use-cases, and (for better or worse) even a few OLAP use-cases. It's the primary store of Facebook, across the entire company. It's the storage layer for ad serving, payments, async task persistence, internal tooling, many many other things. Most of these use-cases make full use of SQL and the relational model.
I was the lead dev on FB's internal DBaaS, which alone supports several thousand different workloads. Despite making up only a few percent of fb's mysql fleet, it alone is still larger than the vast majority of Postgres deployments on earth.
Regarding people not having heard of Postgres: these are big companies with smart, well-informed engineers. And I assure you that Uber and Lyft haven't moved from pg to mysql because they hadn't heard of pg :)
One of your examples is a 9-minute video, from a non-MySQL expert, about mysql 5.5 which came out 6 years ago.
Your other example is a perfectly valid "gotcha", but I don't know of any system that is completely free of gotchas. IMO, needing to know to type utf8mb4 instead of utf8, isn't a good reason to avoid a database altogether.
To reiterate, I am not arguing MySQL is perfect (far from it), or even "better" than pg. I was merely answering the GP's question of why MySQL became more widely-used. I don't wish to engage in yet another mysql-vs-pg endless debate, since my personal opinion is both systems are good choices in different situations.
> Regarding people not having heard of Postgres: these are big companies with smart, well-informed engineers. And I assure you that Uber and Lyft haven't moved from pg to mysql because they hadn't heard of pg :)
Neither was it the other way round, when uber switch from mysql to pg. Both the directional changes appear to have much more to do with changes in engineering leadership, than anything else.
Uber moved from pg to mysql, not the other way around, and they very clearly explained the technical reason they did it https://eng.uber.com/mysql-migration/
Uber moved from MySQL (used as traditional relational DB) to Postgres (used as traditional relational DB) around 2013.
They then refused to ugprade postgres from 9.2 to newer version (and most of the stuff they complain about is not a problem in newer version) and moved to MySQL, used as append-only k/v store (they call Schemaless) now.
One specific thing I like to bash about MySQL is that it doesn't support CTEs (aka: with-statements) which are part of the 1999 SQL standard (nearly 20 years old now). I miss them frequently when working with MySQL.
Big companies like what you listed is not good examples. Since we don't know if they use bare bone MySQL or not. They absolutely have the expertise to modify MySQL and use their own branch. If big names use XXX product, it doesn't mean that product is awesome since that have the money and expertise to modify it.
> we don't know if they use bare bone MySQL or not
No, we know this exactly, because companies freely discuss it. (I've worked for 2 of the companies I listed, and over the years have attended conference talks by pretty much all of the other ones I mentioned.)
The vast majority of these companies use an unmodified copy of either stock (oracle) MySQL, Percona Server, or MariaDB. Of these 3 major options, Percona Server is the most common among large-scale companies.
The companies that modify MySQL (Facebook, Twitter, LinkedIn, Google, Alibaba) readily open-source their changes. They're not really forks, it's more like a patch-set that they port to new versions. They make nice improvements that are often incorporated into Percona Server and some eventually are reimplemented by Oracle to be put back upstream.
The one big exception is Amazon, which doesn't open-source its changes. But aside from them, it's an open source ecosystem. Having companies with "expertise to modify MySQL and use their own branch" is a good thing and this is exactly why it's a good example of MySQL's popularity!
MySQL gained popularity in the late 90s/early 2000s because they took the opposite tactic to PostgreSQL. While PostgreSQL aimed to be a complete SQL rdbms and then become a fast one MySQL aimed to be fast then complete. Also MySQL chose defaults suitable for web application hosting so needed little out of the box configuration.
This meant MySQL was popular in the dotcom boom, and certainly with PHP developers. So MySQL got mindshare even if it has many flaws. Similar to how perl was the language to use in the early web days.
In my experience, most people who used MySQL simply hadn't heard of PostgreSQL (which isn't hard to install either and probably performed well enough for everybody's requirements - at least everybody I talked to).
I used to ask, because I found it baffling that someone would choose an RDBMS that wouldn't even check the size of a column.
I'm a Postgres convert. I used MySQL back in the day because I'd heard of Postgres and everyone said tuning it was a nightmare. May or may not have been true but there's enough documentation and books now, and maybe the configuration has become simpler. I no longer hear that Postgres is hard to configure but that it's an OSS enterprise RDBMS that's continuely improving. Even better, I've experienced that improvement over the last few years.
For a very long time, MySQL had much, much better replication and some people would argue that it still does. It would be nice if MySQL were a little less lax in other regards, but replication is always going too be more important for production sites.
You'll get people who still pick C "for performance" when writing a system that has to handle about 10 requests/second. We have this strange desire to use "the fastest" regardless of whether performance actually matters for our use case and how much we're giving up for it.
> In my experience, most people who used MySQL simply hadn't heard of PostgreSQL
That just means the next question is, "why hadn't they heard of PostgreSQL"? It's not as if MySQL AB was taking out ads in the newspaper to create mindshare.
> I always wondered why MySQL gained more popularity.
very simple
1. LAMP , you got everything packaged, and the database was MySQL
2. soon a lot of cheap hosting options had MySQL as the shared database options
3. phpmyadmin to administrate your website database from a website
I may be missing some history on the PostgreSQL side, but at least ~10 years ago, MySQL was the de-facto option for the wannabe web developer.
I may be wrong but I also credit that MySQL was way easier to administer and didn't have the concept of schema similar to Oracle's.
You installed, ran the "mysql" client application to connect to the server and off you go. PostgreSQL requires you to run as a different user to configure it.
As I said, I might be wrong, but that is my impression using PostgreSQL on Linux.
My theory is a bit different: projects under a single entities control grow faster, but don't usually have better quality. For a while that works, but at some point the technical debt costs you.
It is interesting to consider FreeBSD vs Linux from the same angle. Obviously not an identical situation, but there are definitely interesting parallels there for PostgreSQL vs MySQL.
> I always wondered why MySQL gained more popularity.
Because of the first-mover advantage. When first web pages/apps were created there was no native port of Postgresql for Microsoft Windows. At that time Windows was the main development platform. Postgresql with Windows native support was released in 2005.
Even to this day I still have to Google how to list the databases in PostgreSQL on the odd occasion I need to investigate something. In most other databases eg MySQL, MongoDB, Cassandra etc it's as simple as "show databases"
MySQL (at least earlier on) was _very_ fast for simple selects. This made using it for websites make sense. If all you needed was to display the result of a simple query (most websites) mysql was easy to use, very quick, and quite forgiving.
I worship the creativity of the author to connect Tetris, Czech Republic, Marc Andreessen, Dungeons & Dragons, Mortal Kombat, Clinton, Trump, and Putin.
I find that relatively quiet and less complex music works better for me – such genres as downtempo, nu jazz, trip hop.
While I enjoy a very broad spectrum of music in general (from classical music to death metal, and from avant-garde jazz to hardcore gabba), fast, complex, loud or noisy music seems to get pretty distracting in many cases.
But that might depend on your job, actually. If you are a football player and you spend most of the time working out or outdoors, energetic music may work much better. Or, if you are a factory worker, where you have to deal with 120dB noise over your shift. I don't think ambient would be a good choice there, rather thrash metal or hardcore. :)
If you need some specific examples of "calm" music that works for me, please let me know, I probably could recommend something in particular.
Could you please add screenshots? I myself was a huge fan of FastTracker and Impulse Tracker back in the 90s, but I don't think people are going to download this tool just out of curiosity without seeing pretty pictures of the music app in advance.
PS I apologize if there were screenshots, but I just failed to find them.
Can you please elaborate what you find so "special" in those screenshots from the article? I mean how is it really different from most of the modern apps/websites?
You know, a few years back I had exactly the same attitude towards Git. I hated it, tried to approach multiple times and still hated it. But after working with Git on multiple projects, and having developed some deeper understanding of how things work there, I honestly think now that Git is one of the best tools that have been invented over last 20 years for improving the development processes and engineering excellence. I don't really want to defend it, the learning curve is apparently pretty steep (at least it was for me), but I would just recommend to not give up and keep trying. There are some good tutorials how to handle it and why it's helpful (Atlassian's Git book, for instance).
Brave Software incorporated more than 1 year ago. They raised $7M (?) over its existence. But no one practically knows about them. And who cares about ads and Bitcoin? I personally just ignore them everywhere, have kind of immunity already. The other people use AdBlock. Why would anyone want to pay for removing ads on web, use another browser for that, or pay for that with Bitcoin (who cares?)? I guess, I am missing the whole point of what those guys do and why...