| Stage | Read from | Write to | Authoritative |
|---|---|---|---|
| off | old | old | old |
| dualwrite | old | old, new | old |
| shadow | both | old, new | old |
| live | both | new, old | new |
| rampdown | new | new, old | new |
| complete | new | new | new |
Prerequisites
To use this guide, you should understand:- What migration flags are and how their variations work. To learn more, read Migration flags.
- How to use LaunchDarkly’s SDKs to manage migrations and modernizations. To learn more, read Migrations.
- How applications use a database to read and write data.
When to use a two-stage migration
Some types of migration require only two stages:off: data is read from and written to the old systemcomplete: data is read from and written to the new system
When to use a four-stage migration
For some types of migrations, you need to use two systems at the same time, with one system considered the authoritative version while the result from the other implementation is registered, but not returned. A four-stage migration assumes there are two systems or implementations that can both be used simultaneously and for the same purpose, and that you can compare the executions of the two systems for consistency and performance. Only one version is considered authoritative. This results in four stages:off: data is read from and written to only the old systemshadow: data is read from and written to both systems, but returned from only the old systemlive: data is read from and written to both systems, but returned from only the new systemcomplete: data is read from and written to only the new system
When to use a six-stage migration
Six-stage migrations migrate data from one system of record to another, and may be the most common type of migration. Six-stage migrations can decrease your reliance on technology that might otherwise surround the migration, such as additional testing or flags to enable things before or after a shorter migration. Instead, you can perform a migration elegantly, with one flag. If you need to stop reads from one part of the system during the migration, you can do so without losing data integrity, because both systems can still be written to, depending on what stage you’re in. Additionally, for types of migration that affect persistent state, there may be a requirement to replicate data between implementations. This replication may be performed by a third-party tool, with data changes in the old implementation automatically applied to the new implementation. Alternatively, a snapshot from the old implementation could be applied to the new implementation, backfilling data while in-band writes are simultaneously applied to both old and new implementations to maintain data consistency. The stages of this migration type are:off: data is read from, written to, and returned from only the old system.dualwrite: data is read from only the old system, but written to both the old and the new system. Data is returned from the old system. When the data in the new system is identical to the data in the old system, you can proceed to the next stage.shadow: data is read from and written to both systems. Data is returned from the old system. At this stage, the new system is essentially running silently in parallel with the old system.live: data is read from and written to both systems. Data is returned from the new system. At this stage, the old system is functionally a backup of the new system.rampdown: data is read from the new system and written to both systems. Data is returned from the new system.complete: data is read from, written to, and returned from only the new system. At this stage, you can safely deprecate the old system.
Conclusion
In this guide, you learned about the different types of migration and when to use them. To learn how to implement migration flags in LaunchDarkly, read Migration flags. To learn how to configure your SDK to perform the reads and writes at each stage, read Migration configuration. To learn how to monitor the progress of your migrations, read Migration flag metrics and Understanding potential migration issues.Want to know more? Start a trial.Your 14-day trial begins as soon as you sign up. Get started in minutes using the in-app Quickstart. You’ll discover how easy it is to release, monitor, and optimize your software.
Want to try it out? Start a trial.
Want to try it out? Start a trial.