Compress data with TokuDB for MySQL 5.6

Last Updated: Dec 11, 2017

RDS for MySQL 5.6 supports data compression through the TokuDB storage engine. The TokuDB storage engine also supports transactions and online DDL operations, which are compatible with applications running on a MyISAM or an InnoDB storage engine.

Note that only MySQL 5.6 supports the TokuDB storage engine.

Restrictions

  • The TokuDB storage engine does not support foreign keys.

  • The TokuDB storage engine is not applicable to scenarios where frequent and massive reading of data is required.

Procedure

  1. Run the following command to check MySQL version.

    Note: Currently, only MySQL 5.6 supports the TokuDB storage engine. For MySQL 5.1 or 5.5, you have to upgrade it to MySQL 5.6 first.

    1. SELECT version();
  2. Set the loose_tokudb_buffer_pool_ratio to indicate the proportion that TokuDB occupies in the shared cache of TokuDB and InnoDB.

    1. select sum(data_length) into @all_size from information_schema.tables where engine=’innodb’;
    2. select sum(data_length) into @change_size from information_schema.tables where engine=’innodb and concat(table_schema, ’.’, table_name) in (’XX.XXXX’, XX.XXXX’, XX.XXXX’);
    3. select round(@change_size/@all_size*100);

    In the preceding code, XX.XXXX refers to the database and table to be transferred to the TokuDB storage engine.

  3. Restart the instance.

    For more information, see Restarting an Instance.

  4. Modify the storage engine.

    1. ALTER TABLE XX.XXXX ENGINE=TokuDB

    In the preceding code, XX.XXXX refers to the database and table to be transferred to the TokuDB storage engine.

Thank you! We've received your feedback.