Online migration from final consistency system to strong consistency system

By establishing two-way replication between distributed systems and switching the main system, the data migration problem of unavailable double writing of transactions is solved, and efficient data migration and resource utilization are achieved.

CN118696309APending Publication Date: 2024-09-24GOOGLE LLC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202380021341.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2022-04-08
Filing Date
2023-01-13
Publication Date
2024-09-24

AI Technical Summary

Technical Problem

Existing techniques cannot migrate data from one distributed system to another without locking the data, especially from eventually consistent systems to strong consistency, when transactional double writes are unavailable across both systems. system.

Method used

By establishing two-way replication between the two systems, the first system acts as the primary system and receives write requests and updates the second system asynchronously. When the second system catches up with the first system, it switches to the primary system to handle the reads. and write requests.

Benefits of technology

It achieves efficient data migration without locking the data, ensuring that the two systems can continue to process read and write requests during the migration process, improving data migration efficiency and resource utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118696309A
    Figure CN118696309A
Patent Text Reader

Abstract

A method of migrating data from a first type of distributed system to a second type of distributed system without locking the data is generally disclosed herein, wherein a transactional dual write is unavailable across two systems. The method begins by establishing bidirectional replication between a first system and a second system. The first system will initially operate as a master system, where the master system receives and processes write requests from a client or other device. For each write to the first system, the second system is updated with asynchronous writes. When the second system catches the first system such that both the first system and the second system reflect substantially the same data, the second system may be switched to act as a master system. The second system can now directly receive and process all future read and write requests.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application is a continuation of U.S. patent application No. 17 / 716,093 filed on April 8, 2022, the disclosure of which is incorporated herein by reference. Background Art

[0003] Data migration involves moving data from one system to another. For example, data can be migrated from one database to another, from one format to another, or from one application to another. Migrations are often done to replace or augment a legacy system with a new system that will share the same data set.

[0004] Migrating from a first system to a second system typically involves starting a transactional dual write across the two systems, copying data from the first system to the second system, and making the second system the primary system when all data from the first system has been copied to the second system. However, this approach cannot be used if transactional dual writes are not possible across the two systems, such as from an eventually consistent system to a strongly consistent system. Existing solutions for this type of scenario require locking during the migration, where data cannot be read or modified while the lock is held. Summary of the invention

[0005] The present invention generally discloses a method for migrating data from a first type of distributed system to a second type of distributed system without locking the data, wherein transaction dual writes are unavailable across two systems. The method begins by establishing a two-way replication between a first system and a second system. The first system will initially operate as a primary system, wherein the primary system receives and processes (serves) write requests from a client or other device. For each write to the first system, an asynchronous write is utilized to update the second system. When the second system catches up with the first system, the read processed by the first system or the second system will succeed, then the second system can be switched to act as the primary system. The second system can now directly receive and process all future read requests and write requests.

[0006] Aspects of the present disclosure provide a method for migrating data from a first type of distributed system to a second type of distributed system. The method includes: using one or more processors to start bidirectional replication of data between a first system and a second system; receiving a first request to write first data at the first system; using one or more processors to write the first data to the first system; using one or more processors to asynchronously write the first data to the second system; using one or more processors to determine that a read processed by the first system or the second system will succeed; and using one or more processors to switch the second system to a primary system for processing reads and writes.

[0007] In one example, the method further includes receiving a second request to write second data at the second system; writing the second data to the second system using one or more processors; and asynchronously writing the second data to the first system using one or more processors. In another example, the method further includes stopping the bidirectional replication using one or more processors. In another example, the first system includes an eventual consistency system, and the second system includes a strong consistency system. In another example, the bidirectional replication includes iteratively and continuously copying data from the first system to the second system. In another example, the bidirectional replication also includes iteratively and continuously copying data from the second system to the first system.

[0008] In another example, the method further includes comparing, using one or more processors, a first timestamp of a write to the first system with a second timestamp of a write to the second system. When the first timestamp and the second timestamp are within a threshold range of each other, the read processed by the first system or the second system will succeed.

[0009] In another example, the method further includes comparing, using one or more processors, an overall difference between the data in the first system and the data in the second system. When the overall difference is below a threshold, the read processed by the first system or the second system will succeed.

[0010] In another example, the method further includes reporting, using one or more processors, a metric from the bidirectional replication. When the reported metric is below a threshold, a read processed by the first system or the second system will succeed.

[0011] Another aspect of the present disclosure provides a system, the system comprising: one or more processors; and one or more storage devices, the one or more storage devices being coupled to the one or more processors and storing instructions, the instructions, when executed by the one or more processors, causing the one or more processors to perform operations for migrating data from a first type of distributed system to a second type of distributed system. The operations include: starting bidirectional replication of data between a first system and a second system; writing the first data to the first system based on a received first request to write the first data; writing the first data to the second system asynchronously; determining that a read processed by the first system or the second system will succeed; and switching the second system to a primary system for processing reads and writes.

[0012] In one example, the operation further includes writing the second data to the second system based on the received second request to write the second data; and asynchronously writing the second data to the first system. In another example, the operation further includes stopping the bidirectional replication. In another example, the first system includes an eventual consistency system, and the second system includes a strong consistency system. In another example, the bidirectional replication includes iteratively and continuously copying the data from the first system to the second system. In another example, the bidirectional replication also includes iteratively and continuously copying the data from the second system to the first system.

[0013] In another example, the operations further include comparing a first timestamp of a write to the first system with a second timestamp of a write to the second system. When the first timestamp and the second timestamp are within a threshold range of each other, the read processed by the first system or the second system will succeed.

[0014] In another example, the operation further includes comparing an overall difference between the data in the first system and the data in the second system. When the overall difference is below a threshold, the read processed by the first system or the second system will succeed.

[0015] In another example, the operations further include reporting a metric from the bidirectional replication. When the reported metric is below a threshold, a read processed by the first system or the second system will succeed.

[0016] Another aspect of the present disclosure provides a non-transitory computer-readable medium for storing instructions, which, when executed by one or more processors, causes the one or more processors to perform operations for migrating data from a first type of distributed system to a second type of distributed system. The operations include: starting bidirectional replication of data between a first system and a second system; writing the first data to the first system based on a received first request to write the first data; asynchronously writing the first data to the second system; determining that a read processed by the first system or the second system will succeed; and switching the second system to a primary system for processing reads and writes.

[0017] In one example, the operations further include comparing a first timestamp of a write to the first system with a second timestamp of a write to the second system. When the first timestamp and the second timestamp are within a threshold range of each other, the read processed by the first system or the second system will succeed. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 A block diagram of a migration system according to aspects of the present disclosure is depicted.

[0019] Figure 2 A block diagram further describing a migration system according to aspects of the present disclosure is depicted.

[0020] Figure 3A Depicted is a flow diagram of an example process for migrating data between a first distributed system and a second distributed system according to aspects of the present disclosure.

[0021] Figure 3B A block diagram of a migration system in which bidirectional replication has begun is depicted in accordance with aspects of the present disclosure.

[0022] Figure 3C Depicted is a block diagram of a migration system in which data is written to a first distributed system according to aspects of the present disclosure.

[0023] Figure 3D Depicted is a block diagram of a migration system in which data is asynchronously written to a second distributed system according to aspects of the present disclosure.

[0024] Figure 4A A flow chart depicts an example process for continuing bidirectional replication for a period of time after switching a second distributed system to be a primary system according to aspects of the present disclosure.

[0025] Figure 4B A block diagram of a migration system in which bidirectional replication continues after switching a second distributed system to be a primary system is depicted according to aspects of the present disclosure.

[0026] Figure 4C Depicted is a block diagram of a migration system in which data is written to a second distributed system according to aspects of the present disclosure.

[0027] Figure 4D A block diagram of a migration system in which data is asynchronously written to a first distributed system is depicted according to aspects of the present disclosure.

[0028] Figure 5 Depicted is a block diagram of an example system after migration in which a first distributed system has been stopped according to aspects of the present disclosure. DETAILED DESCRIPTION

[0029] The present invention generally discloses a method for migrating data from a first type of distributed system to a second type of distributed system without locking the data, wherein transactional double writes are unavailable across the two systems, thereby achieving more efficient and / or faster data migration and improved storage and / or computing resource usage. The first type of distributed system can be an eventually consistent system, and the second type of distributed system can be a strongly consistent system. During the migration, both systems can continue to process read requests and write requests.

[0030] The method begins by establishing bidirectional replication between a first system and a second system. Bidirectional replication may include iteratively and continuously reading data from both systems, comparing the data, and copying any newer data from either system to the other.

[0031] The first system will initially operate as the primary system, where the primary system receives and processes write requests from clients or other devices. For each write to the first system, the second system is updated using an asynchronous write. The asynchronous write to the second system may or may not succeed. However, even if it does not succeed, the data written to the first system will eventually be copied to the second system as part of the bidirectional replication.

[0032] When the second system catches up with the first system such that both the first system and the second system reflect substantially the same data, the second system can be switched to serve as the primary system. As an example, it can be determined that the second system has approximately caught up based on comparing a timestamp of a write to the data of the first system with a timestamp of a write to the data of the second system. As another example, it can be determined that the second system has approximately caught up based on an overall difference between the data in the first system and the data in the second system. As yet another example, it can be determined that the second system has approximately caught up based on a metric reported by bidirectional replication.

[0033] Once the second system begins acting as the primary system, it can directly receive and process all future read requests and write requests. As an example, the first system can continue to be updated asynchronously while writes are being made to the second system acting as the primary system. As another example, maintenance on the first system can be stopped, and the second system can be completely relied upon to process reads and writes.

[0034] Figure 1 An example migration system 100 that does not provide transactional double writes is depicted. The migration system 100 may include a first distributed system, which may be an eventually consistent system, and a second distributed system, which may be a strongly consistent system. As an example, if the two distributed systems have different software, functionality, and / or APIs that cannot interact with each other, transactional double writes may not be provided. As another example, if one of the distributed systems does not support transactional double writes, transactional double writes may not be provided.

[0035] A first distributed system, such as an eventual consistency system, may include multiple database replicas 110A-C and a management system 120A-C for each corresponding database. Although only some replicas are shown, it should be understood that the first distributed system may include any number of replicas and corresponding management systems. In an eventual consistency system, when a write is performed by the management system 120A in the distributed database 110A, the multiple replicas 120B-C may not all reflect the same data until the write is fully copied to all replicas 120A-C by each management system 120A-C. Therefore, during the time period between the write request and the copying of the write to all replicas 120A-C, the data in two different replicas 120A or 120B may not be the same. Therefore, if a read request is processed by a replica 120A or 120B during this period, the read request from the two replicas 120A and 120B will produce inconsistent returns. However, once the write is fully copied, where all replicas 120A-C reflect the same data, the distributed system will become consistent, and the replicas 120A-C will return the same data in response to the read request.

[0036] The second distributed system, such as a strong consistency system, may include multiple database replicas 130 and one or more management systems 140 for the database replicas 130. It should be understood that the second distributed system may include any number of replicas and management systems. In a strong consistency system, the data replicas should be identical throughout the distributed database. For example, if a distributed database replica 130 is written to by the management system 140 at a given time, and a read request for the written data is received immediately after the write, the read request should return the same result regardless of which replica 130 processes the read request.

[0037] The migration system 100 may include a syncer program 150 that performs bidirectional replication between a first distributed system and a second distributed system. The syncer program 150 may be included in either management system 120, 140, or on a separate computing device. Bidirectional replication may include iteratively and continuously reading data from both systems, comparing the data, and copying any newer data from either system to the other. Bidirectional replication may enable the second distributed system to be managed as if it were a copy of the first distributed system.

[0038] The migration system 100 may include a migration server 160 for providing write requests for data from a client or other computing device 170 to the first distributed system and / or the second distributed system. The migration server 160 may also provide read requests from the first distributed system or the second distributed system to the client or other computing device 170. The migration server 160 may include an application programming interface (API) 162, a first tool 164 for transmitting data to the first distributed system and / or receiving data from the first distributed system, and a second tool 166 for transmitting data to the second distributed system and / or receiving data from the second distributed system.

[0039] For example, API 162 may include subroutines, data structures, object classes, and other types of software components for allowing servers and clients to communicate with each other. In one aspect, the API may be a software module capable of operating in conjunction with several types of operating systems known in the art. For example, a client may connect to a structured query language (SQL) database server that may operate in conjunction with the API to save and retrieve information data. API 162 may determine whether data received from a write request from client 170 should be provided to the first distributed system and asynchronously provided to the second distributed system, or whether it should be provided to the second distributed system, which will be referred to below. Figures 3A to 5 Further description.

[0040] Client device 170 may be configured with a processor, memory, instructions, and data. A client may be a personal computer intended for personal use, having all the internal components common in a personal computer, such as a central processing unit (CPU), a hard drive, and input / output devices and all components for interconnecting these elements. Client 170 may be any device capable of processing instructions and transmitting data to and from people and other computers, including general-purpose computers, tablet computers, mobile phones, smart watches, home assistants, video game systems, network computers lacking local storage capabilities, television set-top boxes, and other networked devices.

[0041] The client 170 may include an application interface module for accessing services that may be provided by the server 160. For example, the application interface module may include subroutines, data structures, object classes, and other types of software components for allowing the server and client to communicate with each other. In one aspect, the application interface module may be a software module that is capable of operating in conjunction with several types of operating systems known in the art. For example, a client may be connected to a structured query language (SQL) database server that may operate in conjunction with the application interface module to store and retrieve information data.

[0042] Server 160 can provide requests from client 170 over a network. The network and intermediate nodes may include various configurations and protocols, including the Internet, the World Wide Web, an intranet, a virtual private network, a wide area network, a local network, a private network using one or more company-proprietary communication protocols, Ethernet, Wi-Fi, Bluetooth, and HTTP, and various combinations of the foregoing. Such communications may be facilitated by devices capable of transferring data to and from other computers, such as modems (e.g., dial-up, cable, or fiber optic) and wireless interfaces.

[0043] Figure 2 Further details of management system 120, management system 140, and server 160 for migration system 100 are depicted.

[0044] Server 160 includes a set of computing resources, such as one or more processors 210 and memory 220. Processor 210 is configured to execute data 222 and instructions 224 stored in memory 220. For example, processor 210 may execute logic 226 to control whether data 222 is provided to the first distributed system and / or the second distributed system.

[0045] Processor 210 may be any processor, including one or more central processing units (CPUs), graphics processing units (GPUs), field programmable gate arrays (FPGAs), and / or application specific integrated circuits (ASICs). Although not required, server 160 may include dedicated hardware components for performing specific computing processes. Memory 220 may be a type of non-transitory computer-readable medium capable of storing information accessible by processor 210, such as a hard drive, solid-state drive, tape drive, optical storage device, memory card, ROM, RAM, DVD, CD-ROM, writable memory, and read-only memory.

[0046] The memory 220 may store information accessible by the processor 210, including instructions 224 that may be executed by the processor 210 and retrieved, manipulated, or stored by the processor 210. The instructions 224 may be a set of instructions such as machine code that is directly executed by the processor 210, or an instruction set such as a script that is indirectly executed. In this regard, the terms "instructions," "steps," and "programs" may be used interchangeably herein. The instructions may be stored in an object code format to be directly processed by the processor 210, or in other types of computer languages, including scripts or independent source code module sets that are interpreted on demand or compiled in advance. The functions, methods, and routines of the instructions are explained in more detail in the foregoing examples and the example methods below.

[0047] Data 222 may be retrieved, stored, or modified by processor 210 in accordance with instructions. Data 222 may also be formatted in a computer-readable format, such as, but not limited to, binary values, ASCII, or Unicode. In addition, data 222 may include information sufficient to identify the relevant information, such as numbers, descriptive text, proprietary codes, pointers, references to data stored in other memories (including other network locations), or information used by a function to calculate the relevant data.

[0048] Memory 220 may include logic 226 for controlling data in database 110. For example, logic 226 may determine how to handle transactions with database 110. Depending on the state of the migration, logic 226 may handle read requests and write requests in different ways. For example, as described below with reference to Figures 3A to 5 Further described, if the first distributed system and the second distributed system are not yet approximately close, the logic 226 can read data from the first distributed system or write data to the first distributed system. The logic 226 can also write data asynchronously to the second distributed system. If the first distributed system and the second distributed system have become approximately close, the logic 226 can read data from the second distributed system or write data to the second distributed system. The logic 226 can also write data asynchronously to the first distributed system.

[0049] although Figure 2 The processor, memory, and other elements of the server 160 are functionally shown as being located in the same box, but the processor, computer, computing device, or memory may actually include multiple processors, computers, computing devices, or memories that may or may not be stored in the same physical housing. For example, the memory may be a hard drive or other storage medium located in a housing different from the housing of the server 160. Therefore, references to processors, computers, computing devices, or memories will be understood to include references to a collection of processors, computers, computing devices, or memories that may or may not operate in parallel. For example, the server 160 may operate as a load balancing server farm, a distributed system, and the like. In addition, although some of the functions described below are indicated as occurring on a single computing device with a single processor, various aspects of the subject matter described herein may be implemented by multiple computing devices, such as by transmitting information over a network.

[0050] The management system 120 may include one or more processors 230, memory 240, and other components for providing data to and / or receiving data from the database 110. The memory 240 may store information accessible by the processor 230, including instructions 244 executable by the processor 230. The memory 240 may also include data 242 that may be retrieved, manipulated, or stored by the processor 230. The memory 240 may be a type of non-transitory computer-readable medium capable of storing information accessible by the processor 230, such as a hard drive, a solid-state drive, a tape drive, an optical storage device, a memory card, a ROM, a RAM, a DVD, a CD-ROM, a writable memory, and a read-only memory. The processor 230 may be any processor, including one or more central processing units (CPUs), graphics processing units (GPUs), field programmable gate arrays (FPGAs), and / or application specific integrated circuits (ASICs).

[0051] Instructions 244 may be a set of instructions such as machine code that is directly executed by processor 230, or an instruction set such as a script that is indirectly executed. Instructions 244 may be stored in an object code format to be directly processed by processor 230, or in other types of computer languages, including scripts or independent source code module collections that are interpreted on demand or compiled in advance.

[0052] Data 242 may be retrieved, stored, or modified by processor 230 in accordance with instructions 244. For example, data 242 may be stored in a computer register, in a relational database as a table with a plurality of different fields and records, or as an XML document. Data 242 may also be formatted in a computer readable format such as, but not limited to, binary values, ASCII, or Unicode. In addition, data 242 may include information sufficient to identify the relevant information, such as numbers, descriptive text, proprietary codes, pointers, references to data stored in other memories (including other network locations), or information used by a function to calculate the relevant data.

[0053] although Figure 2 The processor 230 and the memory 240 are functionally shown as being located within the same box, but the processor 230 and the memory 240 may actually include multiple processors and memories that may or may not be stored within the same physical housing. For example, some of the instructions 244 and the data 242 may be stored on a removable CD-ROM, while other instructions and data may be stored within a read-only computer chip. Some or all of the instructions and data may be stored in a location physically away from the processor 230 but still accessible by the processor. Similarly, the processor 230 may actually include a collection of processors that may or may not operate in parallel.

[0054] The database 110 may be a single storage device or multiple storage devices, such as a hard drive, random access memory, disk, disk array, tape drive, etc. The database 110 may implement any of a variety of architectures and technologies, including but not limited to direct-attached storage (DAS), network-attached storage (NAS), storage area network (SAN), Fibre Channel (FC), Fibre Channel over Ethernet (FCoE), hybrid architecture networks, etc. In addition, in some examples, the database 110 may include a virtualized or containerized environment. For example, the database 110 may include one or more virtual machines running on a host. The database 110 may store, for example, data files, documents, code, patterns, persistence frameworks, applications, or any of a variety of other information or tools typically stored in a database.

[0055] The management system 140 may include one or more processors 250, memory 260, and other components for providing data to and / or receiving data from the database 130. The memory 260 may store information accessible by the processor 250, including instructions 264 executable by the processor 250. The memory 260 may also include data 262 that may be retrieved, manipulated, or stored by the processor 250. The memory 260 may be a type of non-transitory computer-readable medium capable of storing information accessible by the processor 250, such as a hard drive, a solid-state drive, a tape drive, an optical storage device, a memory card, a ROM, a RAM, a DVD, a CD-ROM, a writable memory, and a read-only memory. The processor 250 may be any processor, including one or more central processing units (CPUs), graphics processing units (GPUs), field programmable gate arrays (FPGAs), and / or application specific integrated circuits (ASICs).

[0056] Instructions 264 may be a set of instructions such as machine code that is directly executed by processor 250, or an instruction set such as a script that is indirectly executed. Instructions 264 may be stored in an object code format to be directly processed by processor 250, or in other types of computer languages ​​including scripts or independent source code module collections that are interpreted on demand or compiled in advance.

[0057] Data 264 may be retrieved, stored, or modified by processor 250 in accordance with instructions 264. For example, data 262 may be stored in a computer register, in a relational database as a table with a plurality of different fields and records, or as an XML document. Data 262 may also be formatted in a computer readable format such as, but not limited to, binary values, ASCII, or Unicode. In addition, data 262 may include information sufficient to identify the relevant information, such as numbers, descriptive text, proprietary codes, pointers, references to data stored in other memories (including other network locations), or information used by a function to calculate the relevant data.

[0058] although Figure 2 The processor 250 and the memory 260 are functionally shown as being located within the same box, but the processor 250 and the memory 260 may actually include multiple processors and memories that may or may not be stored within the same physical housing. For example, some of the instructions 264 and the data 262 may be stored on a removable CD-ROM, while other instructions and data may be stored within a read-only computer chip. Some or all of the instructions and data may be stored in a location physically away from the processor 250 but still accessible to the processor. Similarly, the processor 250 may actually include a collection of processors that may or may not operate in parallel.

[0059] The database 130 may be a single storage device or multiple storage devices, such as a hard drive, random access memory, disk, disk array, tape drive, etc. The database 130 may implement any of a variety of architectures and technologies, including but not limited to direct-attached storage (DAS), network-attached storage (NAS), storage area network (SAN), Fibre Channel (FC), Fibre Channel over Ethernet (FCoE), hybrid architecture networks, etc. In addition, in some examples, the database 130 may include a virtualized or containerized environment. For example, the database 130 may include one or more virtual machines running on a host. The database 130 may store, for example, data files, documents, code, patterns, persistence frameworks, applications, or any of a variety of other information or tools typically stored in a database.

[0060] Figure 3A A flow chart of an example process 300 for migrating data between a first distributed system and a second distributed system is depicted, wherein transactional dual writes are unavailable across the two systems. The example process 300 can be performed on a system of one or more processors in one or more locations. For example, as described above, the migration system 100 can perform the process 300.

[0061] As shown in block 310 and with reference to Figure 3B, initiating bidirectional replication 315 between the first distributed system and the second distributed system. Bidirectional replication 315 may include iteratively and continuously reading data from the two distributed systems, comparing the data, and copying any newer data from either distributed system to the other distributed system. Metadata may be used to compare data. The frequency of comparing data may depend on the number of writes per second of either distributed system, the frequency of changes in the data, and the staleness of the data provided by the first distributed system. For example, timestamps may be used to compare data, and if the data may become stale after a few hours, the data may be compared every 2 to 4 hours. Bidirectional replication may cause the first distributed system to treat the second distributed system as if the second distributed system is a copy of the first distributed system. Bidirectional replication 315 may continue throughout the entire process 300.

[0062] The first distributed system may initially operate as a primary system, as shown in block 320. The primary system may receive and process write requests from clients or other devices, such as client 170.

[0063] As shown in blocks 330 and 340 and with reference to Figure 3C In response to receiving the request to write the data, the data may be written 345 to the first distributed system because it is the primary system. Although the data is shown as being written to database replica 110B, it should be noted that the data may be written to any database replica of the first distributed system. As shown in block 350 and with reference to Figure 3D , data can also be asynchronously written 355 to the second distributed system. For each write 345 to the first distributed system, the second distributed system is updated using an asynchronous write 355.

[0064] The asynchronous write 355 to the second distributed system may or may not succeed. For example, if the asynchronous write 355 is dropped or lost on the network, or the second distributed system becomes temporarily unavailable or overloaded, the asynchronous write 355 may not succeed. However, even if the asynchronous write 355 is unsuccessful, the data written 345 to the first distributed system will eventually be copied to the second distributed system as part of the bidirectional replication 315.

[0065] As shown in block 360, process 300 determines whether the second distributed system has caught up with the first distributed system so that both distributed systems can reflect substantially the same data. When the second distributed system catches up with the first distributed system, read requests processed from either the first distributed system or the second distributed system should provide accurate data.

[0066] As an example, it can be determined that the second distributed system has caught up based on comparing the timestamp of data written to the first distributed system with the timestamp of data written to the second distributed system. For example, the latest timestamp of data written to the first distributed system can be compared with the latest timestamp of data written to the second distributed system. The data written to the first distributed system and the data written to the second distributed system can be the same or different. When the latest timestamps from the first distributed system and the second distributed system are within a threshold range of each other, it can be determined that the read request processed by the first distributed system or the second distributed system can provide accurate data. Therefore, it can be considered that the second distributed system has caught up with the first distributed system.

[0067] As another example, it can be determined that the second distributed system has caught up based on one or more overall differences between the data in the first distributed system and the data in the second distributed system. For example, the overall difference can be calculated by comparing the row-by-row or key-by-key checksums of the two distributed systems or by comparing the data or bytes in each row of the two distributed systems. The overall difference used may depend on the data and the data format stored in the distributed systems. When the overall difference is below a threshold, it can be determined that the read request processed by the first distributed system or the second distributed system can provide accurate data. Therefore, it can be considered that the second distributed system has caught up with the first distributed system.

[0068] As another example, the second distributed system may be determined to be catching up based on one or more metrics reported by the bidirectional replication. For example, the metric may include how many rows or how much data is copied from the first distributed system to the second distributed system and / or from the second system to the first system in each iteration. When the bidirectional replication reports that the metric is below a threshold, it may be determined that the read request processed by the first distributed system or the second distributed system can provide accurate data. Therefore, it may be considered that the second distributed system is catching up with the first distributed system.

[0069] When the second distributed system catches up with the first distributed system, the second distributed system may be switched to act as the primary system, as shown in block 370. In response to a received request to write data, the data may be written to the second distributed system since it is now the primary system.

[0070] As shown in block 380, once the second distributed system acts as the primary system, bidirectional replication 315 may be stopped. Maintenance on the first distributed system may be stopped, and the second distributed system may be fully relied upon to process read and write requests.

[0071] Figure 4AA flow chart depicts an example process 400 of continuing bidirectional replication 315 for a period of time after switching a second distributed system as a primary system. Continuing bidirectional replication 315 after switching allows, for example, immediate rollback to the first distributed system as the primary system if a problem is discovered in the second distributed system. Continuing bidirectional replication 315 after switching can also ensure that any remaining data in the first distributed system can be copied to the second distributed system. The example process 400 can be performed on a system of one or more processors in one or more locations. For example, as described above, the migration system 100 can perform the process 400.

[0072] As shown in blocks 410 and 420 and with reference to Figure 4B , bidirectional replication 315 continues, and the second distributed system operates as the primary system. As shown in blocks 430 and 440 and with reference to Figure 4C , in response to receiving the request to write the data, the data may be written 445 to the second distributed system because it is the primary system. As shown in block 450, the data may also be asynchronously written 455 to the first distributed system. Although the data is shown as being written to database replica 110A, it should be noted that the data may be written to any database replica of the first distributed system. For each write to the second distributed system, the first distributed system is updated using an asynchronous write.

[0073] The asynchronous write 455 to the first distributed system may or may not succeed. For example, if the asynchronous write 455 is dropped or lost on the network, or the first distributed system becomes temporarily unavailable or overloaded, the asynchronous write 455 may not succeed. However, even if the asynchronous write 455 is unsuccessful, the data written to the second distributed system will eventually be copied to the first distributed system as part of the bidirectional replication 315.

[0074] As shown in block 460, after a period of time, bidirectional replication 315 may be stopped. For example, once any remaining data that is still in the first distributed system but not in the second distributed system has been copied to the second distributed system, bidirectional replication 315 may be stopped. In this example, bidirectional replication 315 may be stopped when it reports that zero differences were found to be copied from the first distributed system to the second distributed system.

[0075] Figure 5An example system 500 is depicted after a migration in which a first distributed system has been stopped. The system 500 may include a second distributed system and a server 160. The second distributed system may include multiple database replicas 130 and a management system 140 for the database replicas 130. The server 160 may include an API 162 and a second tool 166 for transmitting data to the second distributed system and / or receiving data from the second distributed system. The server 160 may provide read or write requests for data from a client 170 to the second distributed system. Since the second distributed system may be a strongly consistent system, the data replicas should be identical throughout the distributed database. For example, if a write is made to a distributed database replica 130 at a given time by the management system 140, and a read request for the written data is received immediately after the write, the read request should return the same result regardless of which replica 130 processes the read request.

[0076] Aspects of the methods generally disclosed herein may be implemented in digital circuits, computer-readable storage media, as one or more computer programs, or a combination of one or more of the foregoing. The computer-readable storage medium may be non-transitory, for example, as one or more instructions executable by a cloud computing platform and stored on a tangible storage device.

[0077] In this specification, the phrase "configured to" is used in different contexts related to a computer system, hardware, or part of a computer program. When a system is said to be configured to perform one or more operations, it means that the system has appropriate software, firmware, and / or hardware installed on the system, which software, firmware, and / or hardware, when in operation, causes the system to perform one or more operations. When a piece of hardware is said to be configured to perform one or more operations, it means that the hardware includes one or more circuits that, when in operation, receive inputs and generate outputs based on the inputs and corresponding to the one or more operations. When a computer program is said to be configured to perform one or more operations, it means that the computer program includes one or more program instructions that, when executed by one or more computers, cause one or more computers to perform one or more operations.

[0078] Unless otherwise stated, the foregoing alternative examples are not mutually exclusive, but may be implemented in various combinations to achieve unique advantages. Since these and other variations and combinations of the features discussed above may be utilized without departing from the subject matter defined by the claims, the previous description of the embodiments should be made by way of illustration rather than by way of limitation of the subject matter defined by the claims. In addition, the examples described herein and the provision of clauses expressed as "such as", "including", etc. should not be interpreted as limiting the subject matter of the claims to specific examples; on the contrary, these examples are intended to illustrate only one embodiment of many possible embodiments. In addition, the same reference numerals in different figures may identify the same or similar elements.

Claims

1. A method for migrating data from a first type of distributed system to a second type of distributed system, characterized in that: The method comprises: Initiate bidirectional replication of data between the first system and the second system using one or more processors; receiving, at the first system, a first request to write first data; writing the first data to the first system using the one or more processors; asynchronously writing the first data to the second system using the one or more processors; determining, using the one or more processors, that a read processed by the first system or the second system is to succeed; and The second system is switched to a master system for processing reads and writes using the one or more processors.

2. The method according to claim 1, characterized in that Also includes: receiving, at the second system, a second request to write second data; writing the second data to the second system using the one or more processors; as well as The second data is asynchronously written to the first system using the one or more processors.

3. The method according to claim 1, characterized in that Also included is stopping the bidirectional replication using the one or more processors.

4. The method according to claim 1, characterized in that The first system comprises an eventually consistent system, and the second system comprises a strongly consistent system.

5. The method according to claim 1, characterized in that The bidirectional replication includes iteratively and continuously copying data from the first system to the second system.

6. The method according to claim 5, characterized in that The bidirectional replication also includes iteratively and continuously copying data from the second system to the first system.

7. The method according to claim 1, characterized in that Also included is comparing, using the one or more processors, a first timestamp written to the first system with a second timestamp written to the second system, wherein the read processed by the first system or the second system is successful when the first timestamp and the second timestamp are within a threshold range of each other.

8. The method according to claim 1, characterized in that Also included is comparing, using the one or more processors, an overall difference between data in the first system and data in the second system, wherein when the overall difference is below a threshold, the read processed by the first system or the second system is successful.

9. The method according to claim 1, characterized in that Also included is reporting, with the one or more processors, a metric from the bidirectional replication, wherein when the reported metric is below a threshold, the read processed by the first system or the second system will succeed.

10. A system, characterized in that: include: one or more processors; and one or more storage devices coupled to the one or more processors and storing instructions that, when executed by the one or more processors, cause the one or more processors to perform operations for migrating data from a first type of distributed system to a second type of distributed system, the operations comprising: Starting bidirectional replication of data between the first system and the second system; writing the first data into the first system based on the received first request to write the first data; asynchronously writing the first data to the second system; determining that a read processed by the first system or the second system will succeed; and The second system is switched to be the primary system for handling reading and writing.

11. The system according to claim 10, characterized in that The operations also include: writing the second data to the second system based on the received second request to write the second data; and The second data is asynchronously written to the first system.

12. The system according to claim 10, characterized in that The operations also include stopping the bidirectional replication.

13. The system of claim 10, wherein: The first system comprises an eventually consistent system, and the second system comprises a strongly consistent system.

14. The system according to claim 10, characterized in that The bidirectional replication includes iteratively and continuously copying data from the first system to the second system.

15. The system of claim 14, wherein: The bidirectional replication also includes iteratively and continuously copying data from the second system to the first system.

16. The system of claim 10, wherein: The operations also include comparing a first timestamp written to the first system with a second timestamp written to the second system, wherein the read processed by the first system or the second system will succeed when the first timestamp and the second timestamp are within a threshold range of each other.

17. The system of claim 10, wherein: The operations also include comparing an overall difference between data in the first system and data in the second system, wherein when the overall difference is below a threshold, the read processed by the first system or the second system will succeed.

18. The system of claim 10, wherein: The operations also include reporting a metric from the bidirectional replication, wherein when the reported metric is below a threshold, the read processed by the first system or the second system will succeed.

19. A non-transitory computer-readable medium for storing instructions, characterized in that: When the instructions are executed by one or more processors, the one or more processors are caused to perform operations for migrating data from a first type of distributed system to a second type of distributed system, the operations comprising: Starting bidirectional replication of data between the first system and the second system; writing the first data into the first system based on the received first request to write the first data; asynchronously writing the first data to the second system; determining that a read processed by the first system or the second system will succeed; and The second system is switched to be the primary system for handling reading and writing.

20. The non-transitory computer readable medium of claim 19, wherein: The operations also include comparing a first timestamp written to the first system with a second timestamp written to the second system, wherein the read processed by the first system or the second system will succeed when the first timestamp and the second timestamp are within a threshold range of each other.