Skip to content

Schema Changes

Yoshinori Matsunobu edited this page Sep 16, 2020 · 4 revisions

At Facebook, we change schemas online by our Online Schema Change Tool. The Online Schema Change Tool is also open source, and a recommended way to change MyRocks schemas. It does not block concurrent write requests and replication. It supports MyRocks bulk loading capabilities so that it can change schemas without causing compaction stalls. Usage is like this.

osc_cli copy --rocksdb-bulk-load --rocksdb-bulk-load-allow-sk --ddl-file-list=foo.sql --socket=/tmp/mysql.socket --database=test

See OSC instruction for how to use it.

We recommend using Online Schema Change Tool for MyRocks schema changes, not regular DDLs. MyRocks support for ALTER TABLE / CREATE INDEX is limited and suboptimal -- it does not support Online DDL (so blocking writes to the same table during ALTER), and enters non bulk loading path and trying to load the entire table in one transaction -- which may hit row lock count limit or out of memory. We have plans to improve regular DDL paths in MyRocks in MySQL 8.0, including supporting online and instant schema changes.

Clone this wiki locally