Zero-Downtime Database Migrations with gh-ost and pt-online-schema-change

Written by

in

Schema migrations on large MySQL tables remain one of the hardest operational challenges in production systems. We evaluated gh-ost and pt-online-schema-change for our 800GB user table and found significant differences in replication lag handling, throttling behavior, and cutover safety.

gh-ost operates without triggers by tailing the binary log directly, which eliminates the write amplification problem that pt-osc introduces. However, gh-ost requires binlog_format=ROW and has stricter requirements around foreign keys and generated columns.

For PostgreSQL shops, we have been impressed with pgroll, which uses a shadow-column approach combined with database-level views to provide zero-downtime migrations without the operational complexity of trigger-based tools.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *