Google and Facebook Team Up to Modernize Old-School Databases
wired.com
wired.com
The primary reason Relational databases are so friggin' strong is that they have a solid foundation and maturity. Most new "NoSQL" stuff is immature crap which should never be used in production for any kind of persistent data. But they are being used as such, and I do note that matures the products over time.
I mean, we had "NoSQL" before we had SQL. Tons of schema-less, hierarchical etc DBs, talking directly to your program and such. Anybody that uses them without massive scaling needs doesn't know his history.
- they provide unnecessary features at high cost (e.g. database-wide transactions),
- they don't provide features that are essential (e.g. scalability, distribution, graceful degradation).
By contrast NoSQL data stores like Bigtable are highly scalable and can easily be stacked over to provide more features if needed (see e.g. Megastore, http://pdos.csail.mit.edu/6.824-2011/papers/jbaker-megastore...)
Any Google/FB/Twitter employees here than can elaborate?
MySQL (specifically InnoDB) is extremely efficient as a storage backend compared to PostgreSQL.
There are a few features that make InnoDB better in many cases:
1. Change buffering for IO bound workloads: If you are IO bound, then InnoDB change buffering is a huge, huge win. It basically is able to reduce IO required for secondary index maintenance by a huge amount.
http://dev.mysql.com/doc/innodb/1.1/en/innodb-performance-ch...
2. InnoDB compression: When you are space constrained (say using flash storage), then being able to compress your data is a big win. In our case, it reduces space by around 40% which translates directly to 40% less servers required. While you could do something like run PG on ZFS with compression, for an OLTP workload, you want the compression in the DB so that it can do a lot of work to minimize the compressing and decompressing of data.
https://dev.mysql.com/doc/refman/5.6/en/innodb-compression-i...
3. Clustered index: The InnoDB PK is a clustered index. This makes a lot of query patterns (such as range scans of the PK) very cheap. Combined with covering indexes (which PG now has too!), you can really minimize the IO required by properly tuned queries.
There are a variety of smaller things as well, such as InnoDB doing logical writes to the redo log vs. PG doing full page writes, so on very high write systems, the REDO log bytes written will be dramatically less. Also MySQL replication has traditionally been more flexible than PG, but PG has made some great strides recently, so I don't know if I would maintain that position still.
1-2 years back I saw a benchmark stating that PG works better than MySQL on I/O constrained AWS instances, so I didn't expect this ("I've learned something today").
Since work is/will have to be done to the chosen db, it would be best for everyone if the one chosen was of high integrity.
Of the ones mentioned, I would guess compression is the most complex. For InnoDB this took many years to get the point of it being usable and efficient. Many naive implementations can cause huge overheads for CPU which makes it unusable.
http://smalldatum.blogspot.com/2014/03/redo-logs-in-mongodb-...
As far as when clustering a table is useful, see the CLUSTER command in PG. It is roughly the same places you would want to do it, except it is automatically maintained. You do need to realize what is going on to minimize impact on inserts, but in a lot of cases, data in inserted in generally ascending order so it mostly 'free'. This does make GUIDs really bad for PKs in InnoDB.
Clustered indexes are like covering indexes (which PG got recently). You don't quite realize how useful they are until you get access to it ;)
InnoDB compression for us is primarily for non-lob objects, so TOAST is quite a bit different than the cross-row compression that we get. We will normally do compression of large objects outside of the DB whenever possible.
I'm not saying that InnoDB is always better than PG, but in a lot of cases that I have tested it with, it is indeed better. PG has come a long way recently, including options such as covering indexes to close the gap.
Also from the WebScaleSQL FAQ:
Q: Why didn't you base this on MariaDB, Percona Server, Drizzle, etc.... A: We reached a consensus that MySQL-5.6 was the right choice for this, as it has the production-ready features we need to operate at scale, and the features planned for MySQL-5.7 seem like a fitting path forward for us. We will continue to revisit this decision as the ecosystem evolves.
Q: Why is it called WebScaleSQL? A: While there are a variety of origin stories for the name depending on who you ask, ...
They just don't want to mention it directly. :)
Project page: http://webscalesql.org/