This topic explains how to use LaunchDarkly SDKs to manage migrations or modernizations. You might use this feature if you are optimizing queries, upgrading to new tech stacks, migrating from one database to another, or other similar technology changes. This feature is available for server-side and edge SDKs only.
Before you configure your SDK to manage a migration, you must complete the following prerequisites:
READS and WRITES separatelyTo learn more, read Migration flags.
Depending on how you created your migration feature flag, your migration will have two, four, or six stages. At each stage, you will be reading data from the old destination, the new destination, or both. You will also be writing data to the old destination, the new destination, or both. At each stage, only one of these destinations is considered the authoritative source. In the LaunchDarkly SDK, you can determine which stage of the migration your application is currently in, execute the appropriate read and write methods, and then compare the results to check correctness and view any errors or changes in latency.
The following table describes the stages and which destination is authoritative. Remember that not all migrations will use all stages.
To manage your migration:
For details of how to perform each step, read Server-side SDKs or Edge SDKs, below.
During the migration, you can check the consistency, errors, and latency as you manage your migration. This information is available from the flag’s Targeting tab. To learn more, read Migration flags.
Customizing your migration is rare. If you have additional metrics that you want to track, or if your migration or modernization involves reading and writing from the new and old systems in a different configuration than the two, four, or six -stage migrations provided, you can also use the SDK to customize your migration.
Here’s how:
migrationVariation method to evaluate your feature flag and determine the migration stage.trackMigration method to record your metrics.For details of how to perform each step, read Server-side SDKs or Edge SDKs, below.
This feature is available in the following server-side SDKs:
To manage your migration, first you need to define how to read from and write to the old and new systems, how to check whether two reads are a match, and whether to track errors and latency metrics. To learn more, read Migration configuration.
Then, whenever you need to perform a read or write in the systems that you are modernizing or migrating, call Read or Write. The SDK evaluates the flag, determines which migration stage the flag is in, and performs the reads or writes in the appropriate system.
Here’s how:
To learn more, read Read and Write.
You can check for consistency, errors, or latency under “Migration insights” on the Targeting tab of your migration flag in the LaunchDarkly user interface. To learn more, read Migration flags.
Customizing your migration is rare. If you want to customize your migration, configure your migration information as before.
Then, use the MigrationVariation method to evaluate your feature flag and determine its migration stage. This method returns the migration stage and a tracker that you can use to build the analytics event to send back to LaunchDarkly.
Here’s how:
Next, perform the migration for the appropriate stage. At each stage, the migration may involve reading or writing from one or both systems. You must define the behavior for each stage. To learn more about how LaunchDarkly defines the stages, read Use SDKs to manage a migration, above.
The structure looks like this:
Finally, when the migration operation is complete, call the TrackMigration method to record your metrics:
To learn more, read IMigration, MigrationVariation, and TrackMigration.
To manage your migration, first you need to define how to read from and write to the old and new systems, how to check whether two reads are a match, and whether to track errors and latency metrics. To learn more, read Migration configuration.
Then, whenever you need to perform a read or write in the systems that you are modernizing or migrating, call Read or Write. The SDK evaluates the flag, determines which migration stage the flag is in, and performs the reads or writes in the appropriate system.
Here’s how:
To learn more, read Read and Write.
You can check for consistency, errors, or latency under “Migration insights” on the Targeting tab of your migration flag in the LaunchDarkly user interface. To learn more, read Migration flags.
Customizing your migration is rare. If you want to customize your migration, configure your migration information as before.
Then, use the MigrationVariation method to evaluate your feature flag and determine its migration stage. This method returns the migration stage, a tracker that you can use to build the analytics event to send back to LaunchDarkly, and an error.
Here’s how:
Next, perform the migration for the appropriate stage. At each stage, the migration may involve reading or writing from one or both systems. You must define the behavior for each stage. To learn more about how LaunchDarkly defines the stages, read Use SDKs to manage a migration, above.
The structure looks like this:
Finally, when the migration operation is complete, call the TrackMigrationOp method to record your metrics:
To learn more, read Migration and TrackMigrationOp.
To manage your migration, first you need to define how to read from and write to the old and new systems, how to check whether two reads are a match, and whether to track errors and latency metrics. To learn more, read Migration configuration.
Then, whenever you need to perform a read or write in the systems that you are modernizing or migrating, call read or write. The SDK evaluates the flag, determines which migration stage the flag is in, and performs the reads or writes in the appropriate system.
Here’s how:
To learn more, read Migration.
You can check for consistency, errors, or latency under “Migration insights” on the Targeting tab of your migration flag in the LaunchDarkly user interface. To learn more, read Migration flags.
Customizing your migration is rare. If you want to customize your migration, configure your migration information as before.
Then, use the migrationVariation method to evaluate your feature flag and determine its migration stage. This method returns the migration stage, a tracker that you can use to build the analytics event to send back to LaunchDarkly, and an error.
Here’s how:
Next, perform the migration for the appropriate stage. At each stage, the migration may involve reading or writing from one or both systems. You must define the behavior for each stage. To learn more about how LaunchDarkly defines the stages, read Use SDKs to manage a migration, above.
The structure looks like this:
Finally, when the migration operation is complete, call the trackMigration method to record your metrics:
To learn more, read migrationVariation and trackMigration.
To manage your migration, first you need to define how to read from and write to the old and new systems, how to check whether two reads are a match, and whether to track errors and latency metrics. To learn more, read Migration configuration.
Then, whenever you need to perform a read or write in the systems that you are modernizing or migrating, call the read or write methods from the LDMigration interface. The SDK evaluates the flag, determines which migration stage the flag is in, and performs the reads or writes in the appropriate system.
Here’s how:
To learn more, read LDMigration.
You can check for consistency, errors, or latency under “Migration insights” on the Targeting tab of your migration flag in the LaunchDarkly user interface. To learn more, read Migration flags.
Customizing your migration is rare. If you want to customize your migration, configure your migration information as before.
Then, use the migrationVariation method to evaluate your feature flag and determine its migration stage. This method returns a promise that is resolved with the result LDMigrationVariation. This result includes the migration stage and a tracker that you can use to build the analytics event to send back to LaunchDarkly.
Here’s how:
Next, perform the migration for the appropriate stage. At each stage, the migration may involve reading or writing from one or both systems. You must define the behavior for each stage. To learn more about how LaunchDarkly defines the stages, read Use SDKs to manage a migration, above.
The structure looks like this:
Finally, when the migration operation is complete, call the trackMigration method to record your metrics:
To learn more, read LDMigration. and LDMigrationOpEvent.
To manage your migration, first you need to define how to read from and write to the old and new systems, how to check whether two reads are a match, and whether to track errors and latency metrics. To learn more, read Migration configuration.
Then, whenever you need to perform a read or write in the systems that you are modernizing or migrating, call the read or write methods from the Migrator interface. The SDK evaluates the flag, determines which migration stage the flag is in, and performs the reads or writes in the appropriate system.
Here’s how:
To learn more, read Migrator.
You can check for consistency, errors, or latency under “Migration insights” on the Targeting tab of your migration flag in the LaunchDarkly user interface. To learn more, read Migration flags.
Customizing your migration is rare. If you want to customize your migration, configure your migration information as before.
Then, use the migrationVariation method to evaluate your feature flag and determine its migration stage. This method returns the migration stage and a tracker that you can use to build the analytics event to send back to LaunchDarkly.
Here’s how:
Next, perform the migration for the appropriate stage. At each stage, the migration may involve reading or writing from one or both systems. You must define the behavior for each stage. To learn more about how LaunchDarkly defines the stages, read Use SDKs to manage a migration, above.
The structure looks like this:
Finally, when the migration operation is complete, call the trackMigrationOperation method to record your metrics:
To learn more, read Migrator and trackMigrationOperation.
To manage your migration, first you need to define how to read from and write to the old and new systems, how to check whether two reads are a match, and whether to track errors and latency metrics. To learn more, read Migration configuration.
Then, whenever you need to perform a read or write in the systems that you are modernizing or migrating, call the read or write methods from the Migrator interface. The SDK evaluates the flag, determines which migration stage the flag is in, and performs the reads or writes in the appropriate system.
Here’s how:
To learn more, read ldclient.migrations.
You can check for consistency, errors, or latency under “Migration insights” on the Targeting tab of your migration flag in the LaunchDarkly user interface. To learn more, read Migration flags.
Customizing your migration is rare. If you want to customize your migration, configure your migration information as before.
Then, use the migration_variation method to evaluate your feature flag and determine its migration stage. This method returns the migration stage and a tracker that you can use to build the analytics event to send back to LaunchDarkly.
Here’s how:
Next, perform the migration for the appropriate stage. At each stage, the migration may involve reading or writing from one or both systems. You must define the behavior for each stage. To learn more about how LaunchDarkly defines the stages, read Use SDKs to manage a migration, above.
The structure looks like this:
Finally, when the migration operation is complete, call the track_migration_op method to record your metrics:
To learn more, read ldclient.migrations and track_migration_op.
To manage your migration, first you need to define how to read from and write to the old and new systems, how to check whether two reads are a match, and whether to track errors and latency metrics. To learn more, read Migration configuration.
Then, whenever you need to perform a read or write in the systems that you are modernizing or migrating, call read or write. The SDK evaluates the flag, determines which migration stage the flag is in, and performs the reads or writes in the appropriate system.
Here’s how:
To learn more, read read and write.
You can check for consistency, errors, or latency under “Migration insights” on the Targeting tab of your migration flag in the LaunchDarkly user interface. To learn more, read Migration flags.
Customizing your migration is rare. If you want to customize your migration, configure your migration information as before.
Then, use the migration_variation method to evaluate your feature flag and determine its migration stage. This method returns the migration stage and a tracker that you can use to build the analytics event to send back to LaunchDarkly.
Here’s how:
Next, perform the migration for the appropriate stage. At each stage, the migration may involve reading or writing from one or both systems. You must define the behavior for each stage. To learn more about how LaunchDarkly defines the stages, read Use SDKs to manage a migration, above.
The structure looks like this:
Finally, when the migration operation is complete, call the track_migration_op method to record your metrics:
To learn more, read Migrator and track_migration_op.
To manage your migration, first you need to define how to read from and write to the old and new systems, how to check whether two reads are a match, and whether to track errors and latency metrics. To learn more, read Migration configuration.
Then, whenever you need to perform a read or write in the systems that you are modernizing or migrating, call read or write. The SDK evaluates the flag, determines which migration stage the flag is in, and performs the reads or writes in the appropriate system.
Here’s how:
To learn more, read read and write.
You can check for consistency, errors, or latency under “Migration insights” on the Targeting tab of your migration flag in the LaunchDarkly user interface. To learn more, read Migration flags.
Customizing your migration is rare. If you want to customize your migration, configure your migration information as before.
Then, use the migration_variation method to evaluate your feature flag and determine its migration stage. This method returns the migration stage and a tracker that you can use to build the analytics event to send back to LaunchDarkly.
Here’s how:
Next, perform the migration for the appropriate stage. At each stage, the migration may involve reading or writing from one or both systems. You must define the behavior for each stage. To learn more about how LaunchDarkly defines the stages, read Use SDKs to manage a migration, above.
The structure looks like this:
Finally, when the migration operation is complete, call the track_migration_op method to record your metrics:
To learn more, read Migrator and track_migration_op.
This feature is available in the following edge SDKs:
To manage your migration, first you need to define how to read from and write to the old and new systems, how to check whether two reads are a match, and whether to track errors and latency metrics. To learn more, read Migration configuration.
Then, whenever you need to perform a read or write in the systems that you are modernizing or migrating, call the read or write methods from the LDMigration interface. The SDK evaluates the flag, determines which migration stage the flag is in, and performs the reads or writes in the appropriate system.
Here’s how:
To learn more, read LDMigration.
Customizing your migration is rare. If you want to customize your migration, configure your migration information as before.
Then, use the migrationVariation method to evaluate your feature flag and determine its migration stage. This method returns a promise that is resolved with the result LDMigrationVariation. This result includes the migration stage. It also returns a tracker, which you can ignore. (The tracker is normally used to build an analytics event to send back to LaunchDarkly. However, the Akamai SDK does not support sending events, so there is no need to build one.)
Here’s how:
Next, perform the migration for the appropriate stage. At each stage, the migration may involve reading or writing from one or both systems. You must define the behavior for each stage. To learn more about how LaunchDarkly defines the stages, read Use SDKs to manage a migration, above.
The structure looks like this:
To learn more, read LDMigration.
To manage your migration, first you need to define how to read from and write to the old and new systems, how to check whether two reads are a match, and whether to track errors and latency metrics. To learn more, read Migration configuration.
Then, whenever you need to perform a read or write in the systems that you are modernizing or migrating, call the read or write methods from the LDMigration interface. The SDK evaluates the flag, determines which migration stage the flag is in, and performs the reads or writes in the appropriate system.
Here’s how:
To learn more, read LDMigration.
You can check for consistency, errors, or latency under “Migration insights” on the Targeting tab of your migration flag in the LaunchDarkly user interface. To learn more, read Migration flags.
Customizing your migration is rare. If you want to customize your migration, configure your migration information as before.
Then, use the migrationVariation method to evaluate your feature flag and determine its migration stage. This method returns a promise that is resolved with the result LDMigrationVariation. This result includes the migration stage and a tracker that you can use to build the analytics event to send back to LaunchDarkly.
Here’s how:
Next, perform the migration for the appropriate stage. At each stage, the migration may involve reading or writing from one or both systems. You must define the behavior for each stage. To learn more about how LaunchDarkly defines the stages, read Use SDKs to manage a migration, above.
The structure looks like this:
Finally, when the migration operation is complete, call the trackMigration method to record your metrics:
To learn more, read LDMigration and LDMigrationOpEvent.
To manage your migration, first you need to define how to read from and write to the old and new systems, how to check whether two reads are a match, and whether to track errors and latency metrics. To learn more, read Migration configuration.
Then, whenever you need to perform a read or write in the systems that you are modernizing or migrating, call the read or write methods from the LDMigration interface. The SDK evaluates the flag, determines which migration stage the flag is in, and performs the reads or writes in the appropriate system.
Here’s how:
To learn more, read LDMigration.
You can check for consistency, errors, or latency under “Migration insights” on the Targeting tab of your migration flag in the LaunchDarkly user interface. To learn more, read Migration flags.
Customizing your migration is rare. If you want to customize your migration, configure your migration information as before.
Then, use the migrationVariation method to evaluate your feature flag and determine its migration stage. This method returns a promise that is resolved with the result LDMigrationVariation. This result includes the migration stage and a tracker that you can use to build the analytics event to send back to LaunchDarkly.
Here’s how:
Next, perform the migration for the appropriate stage. At each stage, the migration may involve reading or writing from one or both systems. You must define the behavior for each stage. To learn more about how LaunchDarkly defines the stages, read Use SDKs to manage a migration, above.
The structure looks like this:
Finally, when the migration operation is complete, call the trackMigration method to record your metrics:
To learn more, read LDMigration and LDMigrationOpEvent.