on-internet
← Community

How to design a zero-downtime schema migration strategy for a high-traffic Laravel/MySQL application with hundred of millions rows?

Stack Overflow ·

I am designing a Laravel application that handles millions of daily requests with a MySQL database containing tables with hundreds of millions of rows. A common requirement is adding or modifying columns on high-traffic tables. For example: ALTER TABLE user_events ADD COLUMN metadata JSON NULL; On large tables this can cause metadata locks, replication lag, increased IO, and unpredictable downtime. The application cannot tolerate API downtime, Long-running database locks, Blocking writes and Replica lag causing stale reads. What is the correct strategy for performing schema changes safely in t

Comments

Sign in or sign up to comment and upvote.

No comments yet.