






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







.~
j.:#
LBL-
Lawrence Berkeley Laboratory
UNIVERSITY OF CALIFORNIA
Information and Computing
Sciences Division
Presented at the 1st International Workshop on Interoperability in Multidatabase Systems, Kyoto, Japan, April 8-9, 1991, and to be published in the Proceedings
An Architecture for Identifying Objects in Multidatabases
V.M. Markowitz
February 1991
Prepared for the U.S. Department of Energy under Contract Number DE-AC03-76SF
'-...,n -- o .... r "S"SO
IVC:Z
CIDO IDr+O
lXI
D. IQ.
U s
.... 1:7' "S 0 ID"' "S'< '<. IV
r Ill
I IV ~ U .... ())
.,),.
...
AN ARCHITECTURE FOR IDENTIFYING OBJECTS IN MULTIDATABASES *
ABSTRACf A multidatabase consists of a collection of independent databases that share and exchange data while preserving
of sharing data on objects in a multidatabase, and present an architecture for identifying and referencing objects across databases of a relational multidatabase. This archi- tecture involves associating every database of a relational multidatabase with two relations that contain the identifiers of local and foreign objects, respectively, and enforcing inner and inter database referential integrity constraints. The proposed architecture has no effect on the original organization and manipulation of data in data- bases. We examine the main aspects of implementing this architecture with relational database management systems.
by the Office of Health and Envirorunental Research Program and the Applied Mathematical Sciences Research Program, of the Office of Energy Research, U.S. Depanment of Energy, under Contract DE- AC03-76SF00098.
problem of providing shared access to multiple hetero-
databases, that is, ensuring their (i) design autonomy, by allowing databases to keep their own data model and sche- mas; (ii) communication autonomy, by allowing databases to decide the extent of data exchanged with other data- bases; and (iii) execution autonomy, by allowing databases to decide the time and the plan for executing requests from other databases (see [1], [15]). A collection of independent databases that cooperate in sharing data while preserving their autonomy
needs mechanisms for: (i) providing every database with a global (integrated) view of the multidatabase; (ii) support- ing the exchange of data between databases in the multida- tabase; and (iii) maintaining the integrity of shared data in the multidatabase. Providing a global view of a multidata- base involves solving the (virtual) schema integration problem [1], and is accompanied by the creation of a
that contains information describing the correspondences and mappings between the databases of the multidatabase system. Data exchange in a multidatabase requires some form of cooperation for processing transactions and queries [1], and involves providing every database with a mechanism supporting the specification of multidatabase queries and having the capability of displaying the results of these queries in the specific (local) way of the database. Architectures of such mechanisms are described in [4] and [14]. In this paper we refer to the third mechanism men- tioned above, that maintains the integrity of shared data in a multidatabase.
their autonomy in structuring and manipulating data, objects in different databases of a multidatabase can be represented and identified differently. Identification differences are especially problematic in relational multi- databases where objects are represented by relation tuples, object connections are represented by references between
tuples. and the identity of objects is represented by (pri- mary and foreign) key values; tuple references are enforced in relational databases by referential integrity constraints [3]. We present in this paper an architecture for identify- ing and referencing objects across databases of a relational multidatabase. This architectme involves associating every database of the multidatabase with two relations consisting of identifiers for the local and foreign objects. respectively; the integrity of data in these relations is maintained by enforcing several inner and inter database referential integrity constraints. We show that this archi- tecture preserves the autonomy of the databases in the multidatabase. that is. has no effect on the original organi- zation and manipulation of data in these databases We examine the main aspects of implementing this architec- ture with a relational database management .system (RDBMS) in general. and with the Sybase and Ingres RDBMSs in particular. Sharing objects in an object-oriented multidatabase is one of the main goals of the DOOM system presented in
assumes that all objects are homogeneously identified by object identifiers. and does not address the problem of maintaining the integrity of shared objects. The rest of the paper is organized as follows. In sec- tion 2 we brieft y review the relational concepts used in this paper. In section 3 we define the relations needed for identifying and referencing objects in a relational multida- tabase. The referential integrity constraints that must be enforced for maintaining the integrity of data in these rela- tions are defined in section 4. The implementation of the proposed architecture with an RDBMS is discussed in sec-
A relaJional schema RS is a pair (R , a), where R is a set of relation-schemes and A is a set of dependencies
. over R. We consider relational schemas with a= F u I,
inclusion dependencies, respectively. A relaJion-scheme is a named set of attributes, R; (X;). where R; is the relation-
attribute is assigned a domain , and every relation-scheme, R; (X;), is assigned a relation (value), r;. Two attributes arc said to be compatible if they arc associated with the same domain, and attribute sets X and Y are said to be
compatible iff there exists a one-to-one correspondence of compatible attributes between X and Y. Two (sub)tuples t [X] and t • [Y] are said to be compatible iff attribute sets X and Y are compatible. Let R;(X;) be a relation-scheme associated with relation r;. Tile total projection of r; on a subset W of X; is denoted n:.!.w (r; ). and is equal to ( t [W ]It e r; and t [W] consists only of non-null values}. Let R; (X;) be a relation-scheme associated with
ment of the form R;: Y ~z. where Y and Z are subsets of X;; R;: Y ~Z is saJisfied by r; iff for any two tuples of r; , t and t'. t[Y] = t' [Y] implies t [Z] = t' [Z]. A key asso- ciated with R; is a subset of X;. K;. such that R; : K; ~X; is satisfied by any relation r; associated with R; and there
perty. A relation-scheme can be associated with several candidaJe keys from which one primary-key is chosen. Let R;(X;) and Ri(Xi) be two relation-schemes associated with relations r; and ri, respectively. An inclu-
where Y and Z are compatible subsets of X; and Xi,
foreign-key of R;. Key-based inclusion dependencies are usually called referential integrity constraints [3]. Let RS be a relational schema involving a set of referential integrity constraints, I. The referential integrity {directed) graph associated with RS, G 1 = (V. H), is defined as follows: V =R, and H = {R;-+Ri I R;[Y] cRi[Z] e 1}. A set of referential integrity con- straints I is said to be acyclic iff G 1 does not have directed cycles. A referential integrity constraint R;[Y] cRi[Ki] is associated with an insert-rule, a delete-rule and an update-rule [3]. There is a unique insert-rule. restricted, which asserts that inserting a ruple t into r; can be per- formed only if the tuple of ri referenced by t already exists. Tile delete and update rules define the effect of deleting (resp. updating the primary-key value in) a tuple t' of ri : a restricted delete (resp. update) rule asserts that the deletion (resp. update) of t I cannot be perfonned if there exist tuples in r; referencing t I ; a cascades delete (resp. update) rule asserts that the deletion (resp. update) oft' implies deleting (resp. updating the subtuple t [Y] in) the tuples of r; referencing t'; and a nullifies delete (resp. update) rule asserts that the deletion (resp. update) of t' implies setting to null the subtuple 1 [Y] in all the tuples t of ri referencing t'.
lri
Definition 3.1. Let r be a database of a multidatabase.
relation named L_OBJECTS and associated with three attri- butes. L_OID. Key. and InRelation. respectively (see figure 1). Each tuple of the local-objects relation corresponds to
Metadatabase MDBl : RELATIONS L_OBJECTS L_OID Key InRelation .... .. ...
#1 111-11,1111 PERSON .... .. ...
F_OBJECTS F_OID L_OID InRelalion .... .. ... @I #I MDB2 .L_OBJECI'S .... .. ... Database DBl: PERSON SSN
111-11-
Metadatabase MDB2: RELATIONS L_OBJECTS
LOID Key InRelation ... ... ... @1 John Doe PERSON ... .... ..
F_OBJECTS F_OID L_OID (^) InRelation .... .. ... #1 @1 MDBJ.L_OBJECI'S ... .... .. Database DB2: PERSON First_Name Last_Name ... ... John Doe ... ...
Meta--Multidatabase : LO_RELATIONS .----------., Name MDBJ.L_OBJECTS MDB2. L_OBJECTS
Figure I. Local-Objects and Foreign-Objects Relations.
and includes a surrogate OlD (the value for attribute L_OID). the primary-key value of 1 (the value for attribute Key). and the name of the source relation in which t appears (the value for attribute InRelation). • Primary-keys associated with different relations in a relational database have usually different structures. therefore primary-key values appear in the local-objects relation converted to a common format: every primary-key attribute value is converted into a string of characters, and the strings corresponding to a primary-key value are con- catenated. Associating object identifiers in a local-objects relation with the names of source relations ensures that every OlD appears exactly once in the local-objects rela- tion. Consequently. attribute L_OID can be specified as the primary-key of the local-objects relation.
3.3 Foreign Objects Relation. While the purpose of the local-objects relation defined above is to list the identifiers of the objects represented in
(foreign) objects that are represented in other databases of
the specification of equivalence relationships between local and foreign objects.
Definition 3.2. Let r be a database of a multidatabase.
relation named F_OBJECfS and associated with three attri- butes. F_OlD. L_OID, and InRelation. respectively (see figure 1). where attribute L_OID is allowed to have null values. Each tuple of the foreign-objects relation corresponds to a foreign object that is represented as a local object in another (foreign) database of the multidata- base (i.e. listed in the local-objects relation of that foreign database). and includes the surrogate OID of the foreign object (the value for attribute F_OlD), the name of the (foreign) local-objects relation in which the foreign object appears (the value for attribute InRelation). and possibly the surrogate OlD of a (local) object represented in the
bute L_OID). • Associating the OlD of a foreign object with the OlD of a local object in the foreign-objects relation allows
foreign objects. If such a relationship is not defined for a foreign object, then the value of the L_OID attribute in the corresponding tuple of the foreign-objects relation is null. In the multidatabase shown in figure 1, for example, the persons identified in databases DB l and 082 by OIDs #I and @I, respectively, are specified as being equivalent in
MDB 1 and MDB2. We assume that in a multidatabase an object cannot
that is. that an object can be local to a unique database in a multidatabase. Accordingly,· the OlD of a foreign object appears at most once in a foreign-objects relation, and therefore auribute F_om can be specified as the primary- key of the foreign-objects relation. The information on local-objects and foreign- objects relations (e.g. their names and suucture) is kept in a meta-multidatabase. In the multidatabase example shown in figure 1, for instance, LO_RELATIONS is a
local-objects relations associated with the databases in the multi database.
4.1 Variable Foreign-Relation ReCerential Integrity. Referential integrity constraints are inter-relation depen-
given foreign-key in a relation r; the foreign-relation is considered to be fixed and identical for all the tuples in r; [3]. In addition to this concept of referential integrity, data in local-objects and foreign-objects relations must satisfy a different fonn of referential integrity constraint involving foreign-keys associated with variable, rather than fixed, foreign-relations. The foreign-key of a relation r; involved in such a referential integrity constraint is associated with
foreign-key value must match a primary-key value in the relation indicated by the foreign-relation attribute value in t.
Definition 4.L Let R;(X;) be a relation-scheme associ-
tial integrity constraint is a statement of the fonn R; [Y] ~ R; [A]. where Y is a subset of X; and A is a
the following condition is satisfied: there exists a tuple t' in ri such that t[Y] = p( t' [Z]), whereRi := t[A], Ri(Xi) is the relation-scheme associated with ri , Z is the primary-key associated with Ri, and p is a conversion function associated with Z that converts tuples (such as 1' [Z l) into tuples compatible with the subtuples of r;
corresponding to the attributes of Y (such as t [Y]). • Consider, for example, relation F_OBJECI'S of meta- database MOB 1 in figure 1. In order to ensure that in every tuple t of relation F_OBJECTS the value of attribute F_OlD (e.g @1) matches a primary-key value in the relation whose name is the value of attribute InRelation in t (e.g. MDB2 • L OBJECI'S), the following variable foreign- relation referential integrity constraint must be enforced: F_OBJECTS [F_OlD] ~ F_OBJECI'S [InRelation]. where
relations whose names appear as values of attribute InRe- lation in F_OBJECfS, are identity functions.
4.2 Foreign Keys in the Local-Objects Relation. A local-objects relation is associated with two foreign- keys. as defined below.
Definition 4.2. Let L_OBJECTS be a local-objects rela- tion specified as in definition 3.1. The local-objects rela- tion is associated with two foreign-keys consisting of attri- butes Key and InRelation. respectively, involved in the following referential integrity constraints:
update-rule. • The first referential integrity constraint defined above ensures that each relation name appearing in the local-objects relation is the name of a relation belonging to the underlying database. The delete-rule implies that once a relation r; is deleted from a database r (and conse- quently the name of r; is deleted from the metadatabase
are deleted from the local~bjects relation associated with r. The update-rule implies that renarnings of relations in a database r are reflected in (i.e. propagated to) the local- objects relation associated with r. The second (variable foreign-relation) referential integrity constraint defined above ensures that each
,.
restricted insert-rule. either a cascades or nullifies
The referential integrity constraint above ensures that an
base r , appears in the foreign-objects relation associated
foreign object is deleted from the foreign-objects relation
either deleted or nullified in the re1alions of r. The update-rule implies that updates of OIDs in the foreign- objects relation associated with a database r are reflected
5. IMPLEMENTATION AsPECI'S
required for implementing the architecture presented in the previous two sections using a relational database manage- ment system (RDBMS). Such an implementation involves:
ciating foreign-keys with variable foreign-relations. A multiple foreign-relation referential integrity con- straint is a statement of the form R;[Y] ~ (Rj 1 [Kh], ... ,
relation-schemes, Y is a subset of X;, and for every k, 1~5/n. Kit is the primary-key of Rh, and is compatible
for every tuple t of a relation r, associated with R; the following condition is satisfied: there exists a tuple t' in a
t[Y] = t' [KiA].
It is straightforward to map variable foreign-relation referential integrity constraints into equivalent multiple foreign-relation referential integrity constraints. Consider, for example, the following variable foreign-relation referential integrity constraint specified in definition 4.3: F_OBJEcrs [F_OlD] ~ F_OBJEcrs [InRelation]. The equivalent multiple foreign-relation referential integrity constraint is F_OBJECTS [F_OlD] ~ {MOB l.L_OB.TECTS [L_OID], ... , MDBm.L_OBJECfS [L_OID)}. where the
t Sybasc triggers and lngres rul.u are a special kind of ston::d pro- cedures that are activated (firuf) when a relation is affoct.cd by a data manipulation. These procedures arc specified using extended vcnions of SQL which include control-How statements in addition to sWtclard SQL sutements.
multidatabase consists of databases DBic. 1st Sm. and MDBk.L_OBJECfS denotes the local~bjects relation asso- ciated with database DBk (and belonging to metadatabase MDBk}, 1SicSm. As mentioned above, triggu and rule procedures
referential integrity constraints. However, the enforcement of such constraints implies in general scanning multiple foreign-relations for finding a primary-key value matching
efficient than the enforcement of variable foreign-relation · referential integrity constraints, where the foreign relation
database, that preserves the autonomy of these databases. This architecture allows specifying equivalence relation- ships between objects represented in different databa.ses in a more general way than the equivalence dependencies
equivalent only if they share compatible aunoutes. We have briefly discussed several aspects of imple- menting this architecture using commercial RDBMSs. Only
vide mechanisms that allow such an implementation. However, limitations of the Sybase trigger and lngres nde mechanisms require replacing the variable foreign-relation referential integrity constraints involved in the proposed
enforcement, multiple foreign-relation referential integrity constraints. Finally. note that specifying Sybase trigger
error-prone process, and that these procedures are usually large and hard to maintain [12].
REFERENCES [1] Y. Breitbart, "Multidatabase interoperability", SIG- MOD Record 19.3 (Sep. 1990), pp. 53-@. [2] E.F. Codd, "Extending the relational database model to capture more meaning", ACM Trans. on Database Systems 4, no. 4 (Dec. 1979), pp. 397-434. [3] CJ. Date, "Referential integrity and foreign keys", in Relational Database Writings 1985-1989, Addison- Wesley, 1990. [4] D. Heimbigner and D. McLeod, "A federated archi- tecture for infonnation management", ACM Trans. on Office Inform. Systems 3, 3 (July 1985), pp. 253-278.
[5] lngres, Inc., "INGRES/SQL Reference Manual", Release 6.3, Alameda, California, 1990. [6] S.N. Khoshafian and G.P. Copeland, "Object iden- tity". in Proc. of the ACM OOPSLA Conference, SIG- PLAN Notices, vol. 21, no. 11. pp. 417-423, 1986. [7] W. Litwin and A. Abde11atif, "Mu1tidatabase intero- perability",/EEE Computer, 19, 12 (Dec. 1986), pp. 351-381.
A. Zeroual, "MSQL: A multidatabase language". Technical Report 695, INRIA, June 1987. [9] P. Lyngbaek and D. McLeod, "An approach to object
the 9th Int. Conf. on VWB, 1983, pp. 364-375. [10] D. Maier, The theory of relational databases, Com- puter Science Press, 1983. [11] V.M Markowitz and J.A. Makowsky, "Identifying extended entity-relationship object structures in rela- tional schemas", IEEE Trans. on Software Engineer- ing, 16, 8, (Aug. 1990), pp. 777-790.
referential integrity mechanisms in relational data-
Conf. on Data Engineering, 1991. [13] V.M Markowitz and A. Shoshani, "Representing object structures in relational databases: A modular approach n. submitted for publication. also appeared as Technical Report LBL-28482, Jan. 1991. [14] S. Navathe and al, "A federated architecture for heterogeneous information systems". position paper at NSF Workshop on Heterogeneous Database Sys- tems, Dec. 1989. [15] Report of NSF Workshop on Heterogeneous Data- base Systems, Dec. 1989. [16] Sybase, Inc.• "Transact-SQL User's Guide", Release 4.0, Emeryville, California, 1989.