U.S. patent application Ser. No. 10/950,357 entitled MARKUP LANGUAGE SPECIFICATION OF A DATABASE SCHEMA is incorporated herein by reference for all purposes.
A technique for converting a first version of a database to a second version is disclosed. The technique includes determining available translation steps, selecting a translation path from the first version of the database to the second version, and executing the selected translation steps in the translation path. The translation path includes selected translation steps from among the available translation steps.
The present invention relates generally to data storage. More specifically, database migration is disclosed.
A database schema describes the organization and structure of data in a database. Typically the schema of a database is modified incrementally with each new software release.
Various embodiments of the invention are disclosed in the following detailed description and the accompanying drawings.
The invention can be implemented in numerous ways, including as a process, an apparatus, a system, a composition of matter, a computer readable medium such as a computer readable storage medium or a computer network wherein program instructions are sent over optical or electronic communication links. In this specification, these implementations, or any other form that the invention may take, may be referred to as techniques. In general, the order of the steps of disclosed processes may be altered within the scope of the invention.
A detailed description of one or more embodiments of the invention is provided below along with accompanying figures that illustrate the principles of the invention. The invention is described in connection with such embodiments, but the invention is not limited to any embodiment. The scope of the invention is limited only by the claims and the invention encompasses numerous alternatives, modifications and equivalents. Numerous specific details are set forth in the following description in order to provide a thorough understanding of the invention. These details are provided for the purpose of example and the invention may be practiced according to the claims without some or all of these specific details. For the purpose of clarity, technical material that is known in the technical fields related to the invention has not been described in detail so that the invention is not unnecessarily obscured.
Converting a first version of a database to a second version is disclosed. Available translation steps are determined, a translation path from the first version of the database to the second version is selected, and translation steps in the translation path are executed.
r1 represents the translation from version 1 to version 2. r1 includes a new member translation for the Customer object, where the new member is DOB_US_Format. r2 represents the translation from version 1 to version 2, patch 1. r2 includes a new member translation for the Customer object, where the new member is DOB_Std_Format. r3 represents the translation from version 2 to version 3. r3 includes two member value transform translations for the Customer object. The first member value transform concatenates LastName and FirstName. The second member value transform reformats DOB_US_Format to DOB_Euro_Format. r4 represents the translation from version 2, patch 1 to version 3. r4 includes two member value transform translations for the Customer object. The first member value transform concatenates LastName and FirstName. The second member value transform reformats DOB_Std_Format to DOB_Euro_Format. For example, to migrate a database from version 1 to version 3, either r1 and r3, or r2 and r4 can be applied. The translations are lossless and any available translation path can be taken. In one embodiment, each translation r1-r4 is expressed in a markup language such as XML, as more fully described below.
The following is an example of an XML description of a database (Example 1):
<database version=“2.0.0R18”/>
<object>
</object>
<object>
</object>
In this example, the specification describes version 2.0.0_R18 of a database. The database includes a plurality of objects. Each object includes one or more members, where a member includes a name value pair. For example, the first object has four members: name “127.0.0.1”, type “.com.infoblox.one.node”, first_name “John”, and last_name “Doe”. The first object is a node object. The second object has two members: name “com” and type “.com.infoblox.one.zone”. The second object is a zone object. Any number of objects can be specified. In one embodiment, the XML description of the database used is RTXML, a markup language described in U.S. patent application Ser. No. 10/950,357, which is incorporated herein by reference above.
The following is an example of a Migration Description XML (MDXML) specification of a translation (Example 2):
<STRUCTURE-TRANSFORM STRUCT-NAME=“.com.infoblox.one.node”>
<MEMBER-NAME-CHANGE PRE-XFORM-VALUE=“name” POST-XFORM-VALUE=“node_name”/>
<MEMBER-VALUE-CHANGE MEMBER-NAME=“name” PRE-XFORM-VALUE=“127.0.0.1” POST-XFORM-VALUE=“192.168.1.2”/>
<MEMBER-VALUE-CHANGE MEMBER-NAME=“name” PRE-XFORM-VALUE=“127.0.0.2” POST-XFORM-VALUE=“192.168.1.3”/>
<NEW-MEMBER MEMBER=“DOB” DEFAULT-VALUE=“Jan. 1, 1970”
<MEMBER-VALUE-XFORM>
</MEMBER-VALUE-XFORM>
</STRUCTURE-TRANSFORM>
For example, MDXML may be used to describe a translation such as r1, r2, r3, or r4. In this example, the translation to be applied to structures of type “.com.infoblox.one.node” is specified. The translation may include a set of translations (or transforms), such as the following:
MEMBER-NAME-CHANGE changes the name of a member. For example, if the name of the structure was previously “name”, it would be changed to “node_name”.
MEMBER-VALUE-CHANGE changes the value of a member. For example, if the value of the name of the structure was previously “127.0.0.1”, it would be changed to “192.168.1.2”.
NEW-MEMBER adds a new member to the structure. For example, a new member with name “DOB” and value “Jan. 1, 1970” would be created in the structure.
MEMBER-VALUE-XFORM transforms the value of a member. For example, first_name and last_name values would be transformed according to the concat tag, where the concat tag could indicate a concatenation of the first_name and last_name values.
Other types of translations may also be specified for objects of type “.com.infoblox.one.node”. Translations for other types of objects may also be specified.
The following is an example of an XML description of a database after the translation shown in Example 2 is applied to the database shown in Example 1 (Example 3):
<database version=“2.0.0R19”/>
<object>
</object>
<object>
</object>
As shown, “node” has become “node_name”. The member with name “_type” is unchanged. “dob” is a new member. “full_name” is a new member whose value is the concatenation of the first_name and last_name values. The zone object is the same, since there were no translations described for the zone object in the MDXML translation shown in Example 2.
<rtxml-version-map-list>
<RTXML-VERSION-MAP version=“2.0.0-R18”
md5=“2bf689e0aa69ab0663147908250cacc0”/>
<RTXML-VERSION-MAP version=“2.0.0-R19”
md5=“79fcd96045cb43147845d8336892a835”/>
</rtxml-version-map-list>
The map list uniquely maps a content based key to a database version. In one embodiment, the content based key is a hash value, such as an MD5 sum, of the database schema. In the example shown, the first mapping is from version “2.0.0-R18” to key “2bf689e0aa69ab0663147908250cacc0”. The key was obtained by taking a hash of the version “2.0.0-R18” database schema. Using the map list, the database version can be determined and the appropriate translation graph can be constructed.
Returning to
For example, if the structure transform for objects of type node shown in Example 2 is applied to the node object shown in Example 1, the resulting object would look like the node structure shown in Example 3. The resulting object is written to a file (808), e.g., tmp.xml. It is determined whether the object is the last object in the database XML file (810). If the object is the last object, the process ends (812). If the object is not the last object, the process returns to step 802 and the next object is read. Returning to step 804, if there are no translations for that object type, the object is written to the file (808) and the process continues as described above. The resulting file (e.g., tmp.xml) is the XML file associated with the translated database. The resulting file may be used to generate the new database, such as an object oriented or relational database. In some embodiments, rather than translating one object at a time, objects are translated in groups.
In addition to database migration, the system and methods described herein may also be used for other purposes. For example, in one embodiment the techniques described above are used to manage a database cluster having multiple versions of a database.
x1 represents the translation from version 1 to version 2. x1′ represents the translation from version 2 to version 1. x3 represents the translation from version 2 to version 3. x3′ represents the translation from version 3 to version 2. For example, an update sent from database 902 to database 906 would be translated using x1. An update from sent from database 906 to database 904 would be translated using x1′. An update sent from database 904 to database 908 would be translated using x1. An update sent from database 904 to database 910 would be translated using x1 and x3. Each of translations x1, x1′, x3, and x3′ may be described by an XML file, such as an MDXML file.
Although the foregoing embodiments have been described in some detail for purposes of clarity of understanding, the invention is not limited to the details provided. There are many alternative ways of implementing the invention. The disclosed embodiments are illustrative and not restrictive.
Number | Name | Date | Kind |
---|---|---|---|
5201046 | Goldberg et al. | Apr 1993 | A |
5202982 | Gramlich et al. | Apr 1993 | A |
5295256 | Bapat | Mar 1994 | A |
5970490 | Morgenstern | Oct 1999 | A |
6026408 | Srinivasan et al. | Feb 2000 | A |
6073140 | Morgan et al. | Jun 2000 | A |
6154747 | Hunt | Nov 2000 | A |
6260042 | Curbera et al. | Jul 2001 | B1 |
6289384 | Whipple et al. | Sep 2001 | B1 |
6298354 | Saulpaugh et al. | Oct 2001 | B1 |
6449657 | Stanbach et al. | Sep 2002 | B2 |
6457021 | Berkowitz et al. | Sep 2002 | B1 |
6499037 | Breitbart et al. | Dec 2002 | B1 |
6549901 | Loaiza et al. | Apr 2003 | B1 |
6631519 | Nicholson et al. | Oct 2003 | B1 |
6802056 | Chaiken et al. | Oct 2004 | B1 |
6804677 | Shadmon et al. | Oct 2004 | B2 |
6853997 | Wotring et al. | Feb 2005 | B2 |
7043716 | Zimmer et al. | May 2006 | B2 |
7149746 | Fagin et al. | Dec 2006 | B2 |
7290003 | Tong | Oct 2007 | B1 |
7343377 | van Opdorp | Mar 2008 | B1 |
7623547 | Dooley et al. | Nov 2009 | B2 |
20020169788 | Lee et al. | Nov 2002 | A1 |
20030051226 | Zimmer et al. | Mar 2003 | A1 |
20030140068 | Yeung | Jul 2003 | A1 |
20030159128 | Kunzler | Aug 2003 | A1 |
20030212698 | Mani et al. | Nov 2003 | A1 |
20040064487 | Nguyen et al. | Apr 2004 | A1 |
20040083218 | Feng | Apr 2004 | A1 |
20040088571 | Jerrim et al. | May 2004 | A1 |
20040194102 | Neerdaels | Sep 2004 | A1 |
20040215752 | Satapati et al. | Oct 2004 | A1 |
20050021503 | Chiang | Jan 2005 | A1 |
20050149582 | Wissmann et al. | Jul 2005 | A1 |
20050198630 | Tamma et al. | Sep 2005 | A1 |
Entry |
---|
Grossman, Robert, et al., The Management and Mining of Multiple Predictive Models Using the Predicitve Modeling Markup Language 1999, CiteSeer, whole document. |
Bailey, S. et al., A High Performance Implementation of the Data Space Transfer Protocol (DSTP) Jun. 1999, ACM, whole document. |
Epstein, David. “ICS 161: Design and Analysis of Algorithms Lecture notes for Feb. 8, 1996.” Apr. 28, 1999. pp. 1-5. Retrieved on Jan. 9, 2007 from <http://www.ics.uci.edu/˜eppstein/161/690208.html>. |
U.S. Appl. No. 10/950,357, Bailey et al. |
U.S. Appl. No. 10/950,364, Bailey et al. |
U.S. Appl. No. 10/950,184, Gutti et al. |