3 ms·
MySQL is faster than pg, you should ask why Facebook is running the largest MySQL shop.
by Thaxll 10y ago
MySQL is faster than pg, you should ask why Facebook is running the largest MySQL shop.
- deleted 10y ago[deleted]
- pmontra 10y agoMaybe because they started with a tiny LAMP system in 2004 and got stuck there to the point they invested considerable resources to write their own PHP interpreter and optimize MySQL. From https://www.percona.com/blog/2014/03/27/a-conversation-with-5-facebook-mysql-gurus/ https://www.percona.com/blog/2014/03/27/a-conversation-with-... "we had the MySQL engineering talent we needed to work with the Oracle team to get 5.6 ready for production at our scale." "We all worked hard to adapt 5.6 to our scale and ensure that it would be production-ready. We found some issues after production deployment, but in many cases we could fix the problem and deployed new MySQL binary within one or two days" "Performance regression of the CPU intensive replication was a main blocker for some of our applications" followed by a description of how they addressed that. So it's not vanilla MySQL vs vanilla PostgreSQL. They tailored MySQL to their needs and keep honing it. What they do has little resemblance with what the other 99.9999% of companies do, and I'm probably missing a few 9s. Another excerpt from that post highlights the differences: "For example, typical MySQL DBA at small companies may not encounter master instance failure during employment, because recent mysqld and H/W are stable enough. At Facebook, master failure is a norm and something the system can accommodate." My take: if they started with and stuck to PostgreSQL they'd have to work on it as they did on MySQL.
- hodgesrm 10y agoFacebook guys as I understand it did look carefully at PostgreSQL; at least some of the engineers are very familiar with its internals. They found MySQL satisfactory for a variety of reasons including ability to engineer better performance but also replication which was much better in MySQL for a long time. In fact, for an interesting perspective on the "Facebook stuck on MySQL" topic see [1]. Interestingly much Facebook database work has been outside the relational orbit on systems like Cassandra and HBase, as well as RocksDB. The choice for most web properties today is not MySQL vs. PostgreSQL but RDBMS vs. "other" systems. [1] https://dom.as/2011/07/08/stonebraker-trapped/ https://dom.as/2011/07/08/stonebraker-trapped/
- Thaxll 10y agoTheir MySQL version is pretty much the vanilla version, from your post it sounds like it's very different but it's not. https://github.com/facebook/mysql-5.6 https://github.com/facebook/mysql-5.6
- philwelch 10y agoAlso, if you read their engineering papers it turns out Facebook uses MySQL these days as a storage backend to a graph store and not as a relational database. They also use the replication logs to power their pub-sub system. In other words, Facebook's use case is so large scale and so throughly hacked (in a good way) that it's not necessarily a credit to the idea of using MySQL on a greenfield project.
- morgo 10y agoHarrison answered this question here: https://www.quora.com/Is-Facebook-considering-ditching-MySQL-in-favor-of-MariaDB-like-Google-did https://www.quora.com/Is-Facebook-considering-ditching-MySQL... They continue to use MySQL on new projects.