My use case is the following: I have two java servers. When I want to deploy a new Java application, I need to isolate one of them, deploy a new Java application, apply mysql schema changes, stop first server, activate second servers. Under this scenario, server1 is still working against the old schema for sometime.
What I would like to do is:
- deploy new application in server2
- create a new table
- copy data into new table
- keep new table in sync with old table (just old -> new, not the contrary)
- block server1
- recreate foreign keys pointing to new table
- rename new table to old table
- activate server2
It seems I need pl-online-schema-change but in two steps. First step comprises points 2-4. Second step points 6-7.
From 5 to 8 is the downtime period.
First question is: do points 6 and 7 take long time respect to the previous ones?
Second question is: can I achieve this in pl-online-schema-change?