Does Fivetran Support Blue/Green Deployments for MySQL?
Question
Does Fivetran support blue/green deployments for MySQL?
Environment
All MySQL connectors
Answer
Yes, Fivetran supports blue/green deployments for MySQL, such as those offered by Amazon RDS and Amazon Aurora.
In a blue/green deployment, a production database environment (blue) maintains an up-to-date copy of its data in a separate staging environment (green). When required, the green environment is promoted to production and begins serving production traffic.
During switchover, your infrastructure may briefly drop existing database connections and prevent new connections. If this occurs while a sync is in progress, you may experience a temporary sync failure. The connector automatically attempts to reconnect and resume syncing. You may pause the connection during this time if desired; it is optional.
After switchover, the Fivetran connector resumes incremental syncing from its last stored replication checkpoint on the promoted environment. Whether a historical re-sync is required depends on how that checkpoint is stored, which is determined by your connection's incremental sync method.
Fivetran Teleport Sync
If you are using the Fivetran Teleport Sync incremental sync method, no additional action is required before switchover. After switchover, Fivetran resumes incremental syncing on the promoted environment without requiring a historical re-sync, provided the promoted environment contains the same data.
Binary log
If you are using the binary log incremental sync method, Fivetran tracks replication progress using binary log file positions by default. These positions are specific to the instance that generated the logs.
After a blue/green switchover, the promoted environment has its own binary log files, so the previous binary log file position cannot be resolved. In this situation, a historical re-sync is required.
To avoid a historical re-sync, do the following before switchover:
Enable GTID mode. For more information, see MySQL documentation on Enabling GTID Transactions Online. When enabling GTID mode, MySQL requires
gtid_modeto transition throughOFF_PERMISSIVEandON_PERMISSIVEso that all anonymous transactions are replicated. Skipping these intermediate steps may cause replication errors.Complete at least one successful Fivetran sync with
gtid_modeset toON. This ensures that the replication checkpoint is stored as a GTID cursor rather than a binary log file and offset. Only a GTID-based checkpoint can be resolved on the new environment after switchover.
When gtid_mode is enabled in both environments and at least one sync has completed successfully, Fivetran automatically resumes incremental syncing on the promoted environment after switchover without requiring a historical re-sync.
Because GTIDs are globally unique and consistent across instances in a deployment, a GTID-based checkpoint can be resolved on the promoted environment after switchover, whereas a checkpoint based on a binary log file and position cannot.