This application is related to co-pending U.S. patent application Ser. No. 11/039,528, entitled “Redundant Version Information in History Table That Enables Efficient Snapshot Querying”, filed concurrently herewith.
The present invention relates to data replication and synchronization, and more particularly to the simultaneous replication and synchronization of data.
One conventional approach for facilitating replication and synchronization is to use a single snapshot of the source 101, shared by both the synchronization and the replication. However, while the data is being written during the replication, any attempts to simultaneously read the data during synchronization are blocked to maintain the integrity of the data retrieved. “Simultaneous” as used in this specification, refers to instructions within two different threads attempting to be executed concurrently. In another conventional approach, a plurality of snapshots is shared while providing isolation levels in the mirror 102. Although this approach allows the simultaneous write (during replication) and read (during synchronization) of the snapshots, simultaneous writes during replication and synchronization are blocked. Thus, the conventional approaches are limited in their efficiency of the replication and synchronization processes.
Accordingly, there exists a need for an improved method and system for synchronization-replication concurrency. The method and system should allow simultaneous reads, writes, and read-writes during replication and synchronization, while maintaining data integrity. The present invention addresses such a need.
An improved method and system for synchronization-replication concurrency maintain a history table for a data table in the mirror 102, where the history table can include redundant version values that indicate a period in which data values corresponding to the version values are valid. Replication can thus be performed between a source and a mirror for a current version of the data table, while synchronization is simultaneously performed between the mirror and a client for an earlier version of the data table using the history table. Simultaneous reads, writes, and read-writes are possible while maintaining data reliability. The replication and synchronization processes can be performed at the read-uncommitted isolation level to increase efficiency. The method and system thus increase overall data throughput, reduce client response time, and dramatically enhance end-user satisfaction.
The present invention provides an improved method and system for synchronization-replication concurrency. The following description is presented to enable one of ordinary skill in the art to make and use the invention and is provided in the context of a patent application and its requirements. Various modifications to the preferred embodiment will be readily apparent to those skilled in the art and the generic principles herein may be applied to other embodiments. Thus, the present invention is not intended to be limited to the embodiment shown but is to be accorded the widest scope consistent with the principles and features described herein.
To more particularly describe the features of the present invention, please refer to
Although the embodiment above is described in the context of a history table that uses redundant version values, one of ordinary skill in the art will understand that other types of history tables may be used without departing from the spirit and scope of the present invention.
At version 7, the history table indicates that the data value ‘10’ for key ‘1’ is valid from version 1 onward (represented by infinity), the data value ‘6’ for key ‘2’ is valid from version 1 to 5, and the data value ‘20’ for key ‘2’ is valid from version 6 onward. At version 8, a row update is performed for key ‘2’ to update the data value to ‘888’. Correspondingly, a row for key ‘2’ and data value ‘888’ is inserted into the history table, with its ‘from’ value set to ‘8’ and the ‘to’ value set to infinity. The old row for key ‘2’ with data value ‘20’ is updated so that the ‘to’ value is set to ‘7’. This indicates that for key ‘2’, the data value ‘20’ is valid from version 6 to 7, while the data value ‘888’ is valid from version 8 onward. Also at version 8, a row insert is performed on the data table to insert key ‘3’ with data value ‘30’. Correspondingly, a row for key ‘3’ and data value ‘30’ is inserted into the history table, with its ‘from’ value set to ‘8’ and the ‘to’ value set to infinity. This indicates that for key ‘3’, the data value ‘30’ is valid from version 8 onward.
Assume that replication is performed at version 8, and synchronization is performed at version 7. As illustrated in
With the method and system in accordance with the present invention, no new row can be introduced into and no row can be deleted from the previous version of the data table used by synchronization during replication of the current version. This is because any new row introduced by the replication would have a ‘from’ version value in the history table greater than the version for synchronization. These rows in the history table would not be retrieved by the snapshot query. Also, the ‘from’ version value for old rows in the history table is never changed. Thus, a snapshot of a previous version will be reliably retrieved by the snapshot query. This is true even at the read-uncommitted isolation level. The simultaneous replication and synchronization can thus be performed at this isolation level, increasing the efficiency of the processes, while also ensuring data reliability.
An improved method and system for synchronization-replication concurrency have been disclosed. The method and system maintain a history table for a data table, where the history table includes redundant version values that indicate a period in which data values corresponding to the version values are valid. Replication can thus be performed between a source and a mirror for a current version of the data table, while synchronization is simultaneously performed between the mirror and a client for an earlier version of the data table using the history table. Simultaneous reads, writes, and read-writes are possible while maintaining data reliability. The replication and synchronization processes can be performed at the read-uncommitted isolation level to increase efficiency. The method and system thus increase overall data throughput, reduce client response time, and dramatically enhance end-user satisfaction.
Although the present invention has been described in accordance with the embodiments shown, one of ordinary skill in the art will readily recognize that there could be variations to the embodiments and those variations would be within the spirit and scope of the present invention. Accordingly, many modifications may be made by one of ordinary skill in the art without departing from the spirit and scope of the appended claims.
Number | Name | Date | Kind |
---|---|---|---|
5623661 | Hon | Apr 1997 | A |
5675802 | Allen et al. | Oct 1997 | A |
5870758 | Bamford et al. | Feb 1999 | A |
5870759 | Bauer et al. | Feb 1999 | A |
5950210 | Nelson | Sep 1999 | A |
5956713 | Bamford et al. | Sep 1999 | A |
5956731 | Bamford et al. | Sep 1999 | A |
5963959 | Sun et al. | Oct 1999 | A |
5999931 | Breitbart et al. | Dec 1999 | A |
6092086 | Martin et al. | Jul 2000 | A |
6289335 | Downing et al. | Sep 2001 | B1 |
6295541 | Bodnar et al. | Sep 2001 | B1 |
6377960 | Qiu et al. | Apr 2002 | B1 |
6415299 | Baisley et al. | Jul 2002 | B1 |
6460052 | Thomas et al. | Oct 2002 | B1 |
6516327 | Zondervan et al. | Feb 2003 | B1 |
6631374 | Klein et al. | Oct 2003 | B1 |
6665815 | Goldstein et al. | Dec 2003 | B1 |
6799189 | Huxoll | Sep 2004 | B2 |
20020029218 | Bentley et al. | Mar 2002 | A1 |
20020174416 | Bates et al. | Nov 2002 | A1 |
20020178146 | Akella et al. | Nov 2002 | A1 |
20030131025 | Zondervan et al. | Jul 2003 | A1 |
20030149702 | Saffer et al. | Aug 2003 | A1 |
20040010487 | Prahlad et al. | Jan 2004 | A1 |
20040019614 | Wang | Jan 2004 | A1 |
20050086263 | Ngai et al. | Apr 2005 | A1 |
20050131964 | Saxena | Jun 2005 | A1 |
20050144198 | Bergstraesser et al. | Jun 2005 | A1 |
20060101092 | Ishida et al. | May 2006 | A1 |
Number | Date | Country | |
---|---|---|---|
20060161606 A1 | Jul 2006 | US |