La migration continue (parfois appelée "en cours" ou "en ligne") est un flux continu de modifications d'une base de données PostgreSQL source vers une destination AlloyDB pour PostgreSQL, qui suit un vidage et un chargement complets initiaux. En cas de migration, lorsque le moment est venu de passer à l'utilisation de la destination pour les lectures et les écritures, effectuez une opération promote. La promotion signifie que l'instance de destination est déconnectée de la source et qu'elle passe d'une instance dupliquée à une instance principale.
La migration continue se déroule comme suit:
Au départ, un instantané de la base de données source est créé.
Cela entraîne un verrouillage court (moins de 10 secondes) sur les tables de la base de données, une à la fois, lors de la création du dump. La source peut continuer à accepter les écritures.
Une fois le vidage initial effectué, il est chargé dans la destination.
Une fois le chargement terminé, les modifications en cours (également appelées "capture de données modifiées" ou CDC) sont traitées.
Lorsque le moment est venu de passer à la destination, arrêtez d'écrire dans la source et lancez une promotion. Cela permet à l'application de lire et d'écrire dans la base de données de destination.
Les applications dépendantes peuvent connaître des temps d'arrêt d'au moins la durée du délai de réplication au moment de la décision de promotion.
Migration unique
Ce type de migration consiste à réaliser un seul instantané de la base de données pris à la source, puis à l'appliquer à la destination. Il s'agit essentiellement d'une décharge et d'une importation, où la destination est prête à être utilisée une fois la charge terminée. Toutes les applications qui dépendent de la base de données source peuvent connaître des temps d'arrêt pendant le processus de migration, car aucune nouvelle écriture ne peut être effectuée dans cette base de données pendant la migration.
Pour effectuer une migration ponctuelle, procédez comme suit:
Arrêtez toute écriture de données dans la base de données source.
Lancez un vidage de la base de données source.
Une fois le dump terminé, il est chargé dans la destination. Une fois la charge terminée, une promotion est lancée automatiquement. La base de données de destination devient désormais la base de données principale, et les applications dépendantes doivent y lire et y écrire.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/05 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/09/05 (UTC)."],[[["\u003cp\u003eContinuous migration involves an initial snapshot of the source PostgreSQL database, followed by a continuous stream of changes to the AlloyDB destination, allowing for minimal downtime during the final switch.\u003c/p\u003e\n"],["\u003cp\u003eContinuous migration includes taking an initial database snapshot, loading it into the destination, processing ongoing changes, and finally promoting the destination to primary status.\u003c/p\u003e\n"],["\u003cp\u003eOne-time migration, which is currently unavailable for AlloyDB, involves a single snapshot of the source database and applying it to the destination, requiring a halt in writes to the source during the migration.\u003c/p\u003e\n"],["\u003cp\u003eReplication delay is the time between when a write occurs on the source and the current time, which will account for the downtime during a continuous migration switch.\u003c/p\u003e\n"]]],[],null,["# Types of migration\n\n\u003cbr /\u003e\n\n[MySQL](/database-migration/docs/mysql/migration-types \"View this page for the MySQL version of Database Migration Service.\") \\| [PostgreSQL](/database-migration/docs/postgres/migration-types \"View this page for the PostgreSQL version of Database Migration Service.\") \\| PostgreSQL to AlloyDB\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nOverview\n--------\n\n### Continuous migration\n\nContinuous (sometimes referred to as ongoing or online) migration is a continuous flow of changes from a source PostgreSQL database to an AlloyDB for PostgreSQL destination that follows an initial full dump and load. In the case of a migration, when the time comes to switch to use the destination for reads and writes, perform a `promote` operation. Promotion means that the destination instance is disconnected from the source, and is promoted from a replica instance to a primary instance.\n\nContinuous migration follows these steps:\n\n1. Initially, a snapshot is taken of the source database.\n This incurs a short (under 10 seconds) lockout on the database tables, one at\n a time, as the dump is created. The source can continue accepting writes.\n\n \u003cbr /\u003e\n\n2. After the initial dump is taken, it's loaded into the destination.\n\n3. After the load is completed, the ongoing changes (also known as change data capture or CDC) are processed.\n\n | The delay between when a write occurs on the source and the current time is known as the `Replication delay`.\n\n \u003cbr /\u003e\n\n4. When the time comes to switch to using the destination, stop writing to the\n source and initiate a promotion. This allows the application to read and\n write against the destination database.\n\n5. Dependent applications can experience downtime for at least the\n duration of the replication delay at the time of the decision to promote.\n\n### One-time migration\n\n| One-time migration is currently not available for AlloyDB.\n\nThis type of migration is a single point-in-time snapshot of the database,\ntaken from the source and applied to the destination. This is essentially a dump\nand load, where the destination is ready to be\nused when the load completes. Any applications that depend on the source database\ncan experience downtime during the migration process because there can be no new\nwrites to this database while the migration is in progress.\n\nOne-time migration follows these steps:\n\n1. Stop writing to the source database.\n\n2. Initiate a dump of the source database.\n\n3. After the dump is complete, it's loaded into the destination. When the load\n is completed, a promotion is initiated automatically. The\n destination database now becomes the primary database, and dependent\n applications should read and write to it."]]