32. Cypress data model conceptsIn this section, we give an informal description of the Cypress data model. We describe theparticulars of the Cedar interface in Section 3. 2.1 Data independenceWe deal here with the conceptual data model: the logical primitives for data access and data typedefinition. This should be carefully distinguished from the physical data storage and accessmechansisms. The physical representation of data is hidden as much as possible from the databaseclient to facilitate data independence, the guarantee that a user's program will continue to work(perhaps with a change in efficiency) even though the physical data representation is redesigned. For any particular database using our conceptual data model, the actual specification of the types ofdata in the database, using the primitives the model provides, is termed the data schema. Note thata mapping must be provided between the conceptual data model and the physical representation,either automatically or with further instruction from the client; we will do some of both. Thelogical to physical mapping is intimately associated with the performance of the database system asviewed by the user performing operations at the conceptual level.2.2 Basic primitivesThree basic primitives are defined in the model: an entity, datum, and relationship.An entity represents an abstract or concrete object in the world: a person, an organization, adocument, a product, an event. In programming languages and knowledge representation entitieshave variously been referred to as atoms, symbols, and nodes. A datum, unlike an entity, representsliteral information such as times, weights, part names, or phone numbers. Character strings andintegers are possible datum types.It is a policy decision whether something is represented as an entity or merely a datum: e.g., anemployee's spouse may be represented in a database system as a datum (the spouse's name), or thespouse may be an entity in itself. The database system provides a higher level of logical integritychecking for entities than for datum values, as we will see later: unique entity identifiers, checks onentity types, and removal of dependent data upon entity deletion. We shall discuss theentity/datum choice further in Section 4.2.We will use the term value to refer to something that can be either a datum or an entity. In manyprogramming languages, there is no reason to distinguish entity values from datum values. Indeed,<\OpT-qPQp?N1GrCpspA<!? tpP=Msp;;a7=505Ms p 2";0T .k`,7A%r"p5s ps p(A<");EV"{spSFD  Z hEt+sp <d?# =]iCYPRESS DOCUMENTATION4most of the Cypress operations deal with any kind of value, and some make it transparent to thecaller whether an entity or datum value is involved. The transparent case makes relationaloperations possible in our model, as we will see in Section 2.5.A relationship is a tuple whose elements are [entity or datum] values. We refer to the elements(fields) of relationships by name instead of position. These names for positions are called attributes.Note that we have separated the representatives of unique objects (entities) from the representationof information about objects (relationships), unlike some object-oriented programming languagesand data models. Therefore an entity is not an "object" (or "record") in the programming languagesense, although entities are representatives of real-world objects. We also define entity types, datum types, and relationship types. These are called domains,datatypes, and relations, respectively. We make use of these three types through one fundamentaltype constraint: every relationship in a relation has the same attributes, and the values associatedwith each attribute must be from a pre-specified domain or datatype. One might think of a relationas a "record type" in a programming language, although relations permit more powerful operationsthan record types.As an example, consider a member relation that specifies that a given person is a member of a givenorganization with a given job title, as in the following figure. The person and organization might beentities, while the title might be a string datum. We relax the fundamental type constraintsomewhat in allowing a lattice of types of domains: a particular value may then belong to the pre-specified domain or one of its sub-domains. For example, one could be a member of a University,a Company, or any other type of Organization one chooses to define. Other relations, e.g. an"offers-course" relation, might apply only to a University.<==BBpB-.C@CtlJeC)+zRD@:p Cǿ`3dDs?Cc`EufdDpC0tCCC6@C?9C|+5޽ yBDrCtlGbpEd\Dm"CPмa@B@CBÐueCClDhC,B"BP;>%}%~Dq#Cڂ%|-d CZBCW2D@D@CQ2@/ CEDrClC -RdC`CQ2+ACh"ClCCBCK27AD@D`-d CZ,B"3>BmCڂ%~@|CڂCڃCHB";>B] Cl@DbC -cCHBhpBClB CECClG,CZBPB%}CڂDq"CZ%~%|-cBBDD@D@C`0/BCCDrl -cw+ABD $DbCBCZ7ABDD@D`-c:,BmB%}%~Dq#Cڂ%|CHCH*B]BClBCCg ClG-co BBm CEDrClC CZB BB]CڂCڂCZ%~Cڃ-b,BBAD@D`C`A_BBACClDhC-RbBBB Cl@DbC CZ,BBB/D@D@-bBBpB%}CڂDq"CZ%~%|CH*BpBCh"ClCC,cCHCBBm3?CDrl BBB];@Cڂ%~@|CڂCڃ,c:,CZCW4AD@D`A_CQ3AClB CECClGJohn Smith]EϕEu Bk@BBpB-.CCtlLeC)+zRD@:p Cǿ`3dDs?C`#a4EufdDpC0tCCC6@C?9C|+5޽ yBDrCtl"bEd\Dm"CPмa@B@CBÐueCClDhC,B"BP;>%}%~Dq#Cڂ%|&ud)CZBCW2D@D@CQ2@/ CEDrClC &d7C`CQ2+ACh"ClCCBCK27AD@D`&d)CZ,B"3>BmCڂ%~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`8\CZ,B$3>BmCڂ%~݀|CڂCڃCHB$;>B] Cl@DbC 8\fCHBhpBClD CECClG,CZBPB%~CڂDq"CZ%~%|9\4BBDD@D@C`@/BCCDrl 9[+ABD "DbCBCZ7ABDD@D`9[,BmB%}%~Dq#Cڂ%|CHCH*B]BCl@CCg ClG8[n BBm CEDrClC CZB BB]CڃCڂCZ%~Cڃ8[e,BBAD@D`C`A_BBACClDhC8r[WBBB Cl@DbC CZ,BBB/D@D@85[eBBpB%~CڂDq"CZ%~%|CH*BpBCh"ClCC8[CH CBBm3?CDrl B BB];@Cڂ%~݀|CڂCڃ7[,CZCW4AD@D`A_CQ3AClD CECClG&pc+޻OH@0>Ba .Dd^CKDmD잒Ba$B*ɀC]C&DAZC]%aiA/+B@CSPH|FD]C}DYDCރd\B7Cs@CLC Cs@$_ڲ=ĪCC%Au34/-DNCV`-C^PD+BWAu M0 CZCDC+@2ECZ$^C޻B~tAw!0 ,DCC,BNGdDx BmDhC>DEHCR(tBG CqCC|R@Cp/N_G"PDCX=༠kBOXD\`CDzEVLAB×CJ~xPCACC뀻CC1aEQ滃:By@ 0ߨC>@CCD:UJA{@CVVbC[D]DBြc4B`rDS߾=ؽBxPCy)HC\C{#cDԩ ,' ?Ȗ,CDh8C>C.5_DDo!໚hN7p4A`C!ြ CCDn벾0Mp.AU@!C\DpCn)!6^lD'H bBdBsC̀C_C$D|NA /ǰ)`*CDrCC!*ZaptFpt pjRajPQsp@jN GjK<%jIj;_3j7+5j5OVspj3Jj0X j.?!j,}_j*I$j&m9j$84(` ]j+7jLEjspC jsp,spjJj{Bj Aspj jBj 6djRj Zj&sp%jd$ M >[{ [w$x 77777777777777777x7777777777777777777777_x77777777777777777x77777777777777777rcr\W/[w9[Wx 77777777777777777x77777777777777777x777777777777777777777777 _%^/r^w6_7#####%[W'd2a 777777 Q;78'sp"5 I37(1sR/>s p"- W*G()1&m r:p&3T[ /+hG/ upup( |tupupClupup+dup% v=\CYPRESS DOCUMENTATION8Five basic operations are defined for relationships:1.DeclareRelationship[relation, list of attribute values]: Returns a relationship with thegiven attribute values in the given relation.2.DestroyRelationship[relationship]: Destroys a relationship.3.RelationOf[relationship]: Returns a relationship's relation.4.GetF[relationship, attribute]: Returns the value associated with the given attribute of thegiven relationship.5.SetF[relationship, attribute, value]: Sets the value of the given relationship attribute.The operations upon relationships recognize a specially-distinguished undefined value for anattribute. Unassigned attributes of a newly-created relationship have this value. A client of the datamodel may retrieve a value with GetF and test whether it equals the distinguished undefined value,and may set a previously defined value to be the distinguished undefined value with SetF.Other "convenience" operations are built on top of the basic operations on entities andrelationships: properties and translucent attributes. They are described in Section 2.6. Althoughthese operations are not essential to the basis of the Cypress model, they do furnish a fundamentallydifferent perspective on the model. They provide a mechanism to associate information directlywith entities (instead of through relationships) and to write programs largely independent ofattribute types.The reader will also note that we have ignored issues of concurrent access and protection in thebasic operations. We will see later that an underlying transaction, file, and protection is associatedwith the relation and domain handles used in the basic operations. This convenience allows us totreat concurrency, protection, and data location orthogonally.2.5 Aggregate operationsThere are two kinds of operations upon domains and relations, the aggregate types in our model:the definition of domains and relations, and queries on domains and relations. We first discusstheir definitions.Schema definitionAs in other database models and a few programming languages, the Cypress model is self-representing: the data schema is stored and accessible as data. Thus application-independent toolscan be written without coded-in knowledge of the types of data and their relationships.ZaptFpt pjR4N`u:p`Lu-Im`u$pFe`up"C]`up+`A)>!`u'p( j:E Fsp j8Sj5upj3)+upj/ !Dj-s psp" j+cQj).3,j&!<j$j CjgjEjL>jrjpBspj 4,j jsjp<jMjdW M >[{CYPRESS DATA MODEL CONCEPTS9Client-defined domains, relations, and attributes are represented by entities. These entities belong tospecial built-in domains, called the system domains:the Domain domain, with one element (entity) per domainthe Attribute domain, with one element per attributethe Relation domain, with one element per relationThere is also a predefined Datatype domain, with pre-defined elements StringType, BoolType, andIntType, called built-in types. We do not allow client-defined datum types at present.Information about domains, relations, and attributes are represented by system relations in which thesystem entities participate. The pre-defined SubType relation is a binary relation between domainsand their subdomains. There are also predefined binary relations that map attributes to informationabout the attributes:aRelation: maps an attribute entity to its relation entity.aType: maps an attribute to its type entity (a domain or a built-in type)aUniqueness: maps an attribute entity to {TRUE, FALSE}, depending whether it is partof a key of its relation. We are assuming only one key per relation, here; our implementation relaxes thisassumption in the case of single-attribute keys. The following diagram graphically illustrates a segment of a data schema describing the memberrelation and several domains. The left side of the figure shows two subdomains of Organization,(Company and University), and the right shows the types and uniqueness properties of the memberrelation's attributes memberOf, memberIs, and memberAs.<==CClDhC,B$BP;>%}%~Dq#Cڂ%|CYiCZBCW2D@D@CQ2@/ CEDrClC CRYwC`CQ2+ACh"ClCCBCK27AD@D`CYiCZ,B$3>BmCڂ%~݀|CڂCڃCHB$;>B] Cl@DbC CYFCHBhpBClD CECClG,CZBPB%~CڂDq"CZ%~%|CYBBDD@D@C`@/BCCDrl CX+ABD "DbCBCZ7ABDD@D`CX,BmB%}%~Dq#Cڂ%|CHCH*B]BCl@CCg ClGCXhn BBm CEDrClC CZB BB]CڃCڂCZ%~CڃCXE,BBAD@D`C`A_BBACClDhCCRX7BBB Cl@DbC CZ,BBB/D@D@CXEBBpB%~CڂDq"CZ%~%|CH*BpBCh"ClCCBXhCH CBBm3?CDrl B BB];@Cڂ%~݀|CڂCڃBX,CZCW4AD@D`A_CQ3AClD CECClG+dWD`D`@@D`@CCCD`C@+dWC`BCQ4ClBCCg ClG,BCK4/D@D@+dBCZBtB 3@CڂCڂCZ%~CڃBtB ;@ $DbC,dCHCHCBBh3>CClDhC,B"BP;>%}%~Dq#Cڂ%|,5dCZBCW2D@D@CQ2@/ CEDrClC ,rdC`CQ2+ACh"ClCCBCK27AD@D`,dCZ,B"3>BmCڂ%~@|CڂCڃCHB";>B] Cl@DbC ,dCHBhpBClB CECClG,CZBPB%}CڂDq"CZ%~%|-dBBDD@D@C`0/BCCDrl -dW+ABD $DbCBCZ7ABDD@D`-d,BmB%}%~Dq#Cڂ%|CHCH*B]BClBCCg ClG,co BBm CEDrClC CZB BB]CڂCڂCZ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`=e8C7DlBEu|DtC8ؼ!PC}/7C@Ҁ]-C#c1Ҽ2nBJн;.@p  CIDqCj/@ DǪrDAV6BX?CCB1t4CD!c+'CKu1W*M4xPDsDCˈ DZDnΗB> 𽡦PCxCj0WCx bj#,CZ?p7!8Bgx"ր(8DqC"ԀDBfD{5BIsAAߓ CVCˈBO4w`CTaRelationDiB/^DGslA%17`?mC=B7CB[A+p3(@W.A DED\u-0]D9Acs9𑽡BoCvtPJCVCwZDP%>7DhECH>$cgC CC@=Cۀ ` ^mDYC `CMCDHECM ^t ZtkdDHCqt ^zB_CpDYpSB_ Z UB"@CnCB sZoCDl3` dSubType R[[D@D@ R[D@D``~]>/H)DrCз`CWCиB"/H`CX ]BZ*_@ DoC$`*`]lCՠC$Cr,6 ۠CՠZYDg3C"ZCC"C2@`C)cm `mCؐ@#h`$CjCؐcA'oCjDqCP#'p`n^Cݓ@(CVpCݔ`@"lCVDpJ`Cj("l^.\FCw;=BXCECw=^CDDr€ 0\CXC` vC\0CC`\+iCDq ` uh+YptpXtptptQZ 2Q$x 77777777777777777x77777777777777777-cx77777777777777777x77777777777777777x77777777777777777x77777777777777777x77777777777777777x77777777777777777RWcW ####5Z ####DRX7 777=2b Ia773bw 7777+R_ 77777!bw 77?r\W 777772] 77,2X ####2Vw 77Z Z__+[=_W##########x77777777777777777rT #### 2\########vVtuCYPRESS DOCUMENTATION10DeclareSubType[superdomain, subdomain]DeclareRelation[name], and for each attribute:DeclareAttribute[name, relation, type, uniqueness].QueriesThe operation RelationSubset[relation, attribute value list] enumerates relationships in a relationsatisfying specified equality constraints on entity-valued attributes and/or range constraints ondatum-valued attributes. For example, RelationSubset might enumerate all of the relationshipsthat reference a particular entity in one attribute and have an integer in the range 23 to 52 inanother.The operation DomainSubset[domain, name range] enumerates entities in a domain. Theenumeration may optionally be sorted by entity name, or restricted to a subset of the entities with aname in a given range.More complex queries can be implemented in terms of DomainSubset and RelationSubset. Afuture implementation will provide a MultiRelationSubset operation to efficiently enumerate singlequeries spanning more than one relation. MultiRelationSubset operates upon a parsedrepresentation of the query language, and produces the same kind of enumeration asRelationSubset. See CSL-83-4 for more details. 2.6 Convenience operationsSome more convenient specialized operations are built upon the basic operations described in theprevious two sections. They implement what we call properties and translucent attributes. Althoughtheoretically speaking these operations add no power to the model, they permit a significantlydifferent perspective on the data access and so should be thought of as part of the model.PropertiesProperties allow the client to treat entities as if they, like relationships, had "attributes." Theyprovide the convenience of treating attributes of relationships that reference an entity as if theywere attributes (or properties) of the entity itself. The property operations are: 1.GetPList[entity, attribute1, attribute2]: Attribute1 and attribute2 must be from the samerelation. Returns the values of attribute1 for all relationships in the relation that referencethe entity via attribute2. Attribute2 may be omitted, in which case it is assumed to be theonly other entity-valued attribute of the relation.[ptFpt p VSu&`Pp VMu3jIsjEp u.p&jCDjA'u p)j?^Jj=)j9M u!p j7Kj4j054u pu pj.%up j+7(8upj)MCNj'cu p"j! rj1pOj4s ps p jP j9!js jpej [j ss p6`upu tu  tu  tpu tp`!utp5`uutuu tup, `d3 M S=\CYPRESS DATA MODEL CONCEPTS112.GetP[entity, attribute1, attribute2]: this is identical to GetPList except exactly onerelationship must reference the entity via attribute2; otherwise an error is generated. GetPalways returns one value.3.SetPList[entity, attribute1, value list, attribute2]: Attribute1 and attribute2 must be fromthe same relation. Destroys any existing relationships whose attribute2 equals the entity,and creates new ones for each value in the list, with attribute1 equal to the value, andattribute2 equal to the entity. Attribute2 can be defaulted as in GetPList.4.SetP[entity, attribute1, value, attribute2]: this is identical to SetPList except it simplyadds a new relationship referencing the entity instead of destroying any existing ones(unless attribute1 is a key of its relation, in which case the existing one must be replaced).Thus the property operations allow information specified through relationships to be treated asproperties of the entity itself, in single operations. The property operations and the operationsdefined in earlier sections may be used interchangeably, as there is only one underlyingrepresentation of information: the relationships. As an example of the use of properties, considerthe following database:<==CClDhC,B"BP;>%}%~Dq#Cڂ%|-[)CZBCW2D@D@CQ2@/ CEDrClC -[7C`CQ2+ACh"ClCCBCK27AD@D`.[)C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L CONCEPTS13one did. See the description of ChangeName in Section 3.4 for precise semantics in our implementation, however. 2.7 NormalizationA few comments on relational normalization are included here for users who must do their own dataschema design. Others may skip to the next section.A relation is normalized by breaking it into two or more relations of lower order (fewer attributes)to eliminate undesirable dependencies between the attributes. For example, one could define a"publication" relation with three attributes:Publication:PersonBookDateGeorgeBackgammon for Beginners1978JohnBackgammon for Beginners1978MaryHow to Play Chess1981MaryHow to Cheat at Chess1982This relation represents the fact that John and George wrote a book together entitled "Backgammonfor Beginners," published in 1978, and Mary wrote two books on the subject of chess, in 1981 and1982. Alternatively, we could encode the same information in two relations, an author relation and apublication-date relation:Author:PersonBookGeorgeBackgammon for BeginnersJohnBackgammon for BeginnersMaryHow to Play ChessMaryHow to Cheat at ChessPublication-date:BookDateBackgammon for Beginners1978How to Play Chess1981How to Cheat at Chess1982Although the second two relations may seem more verbose than the first one, they are actuallyrepresentationally better in some sense, because the publication dates of books are not representedredundantly. If one wants to change the publication date of "Backgrammon for Beginners" to 1979,for example, it need only be changed in one place in the publication-date relation but in two placesin the publication relation. If the date were changed in only one place in the publication relation,+[5ptpXtptpt;pSZt&BpMrIp s p7G4DX B^@U- "*%@' #s !g!p!g!  U    s pi i si >i 6JFaKd9, >Q\OCYPRESS DOCUMENTATION14the database would become inconsistent. This kind of behavior is called an update anomaly. Thesecond two relations are said to be a normalized form (as it happens, third normal form) of the firstrelation, and thereby avoid this particular kind of update anomaly. Relational normalization is not strictly part of the Cypress data model. However the model'soperations (and the tools we will develop in the implementation) encourage what we will callfunctionally irreducible form, in which relations are of the smallest order that is naturally meaningful. A relation is in irreducible form if it is of the smallest order possible without introducing newartificial domain(s) not otherwise desired (all relations can be reduced to binary by introducingartificial domains). We will allow a slight weakening of irreducible form, functionally irreducibleform, which permits combining two or more irreducible relations only when their semantics aremutually dependent (and therefore all present or absent in our world representation). For example,a birthday relation between a person, month, day, and year can be combined instead of using threerelations. Another example would be an address relation between a person, street, city, and zip code.Combining an age and phone relation would not result in functionally irreducible form, however, astheir semantics are not mutually dependent. The functionally irreducible relations seen by the user are independent of the physical representationchosen by the system for efficiency, so we are concerned only with the logical data access. Note thatin addition to avoiding update anomalies, functionally irreducible form provides a one-to-onecorrespondence between the relationships in the database and the atomic facts they represent, acanonical form that is in some sense more natural than any other form. 2.8 SegmentsWe would like a mechanism to divide up large databases, to provide different perspectives or subsetsof the data to different users or application programs. In this section we discuss a mechanism toprovide this separation: segments. A segment is a set of entities and relationships that a databaseclient chooses to treat as one logical and physical part of a database.In introducing segments, we will slightly change the definition of an entity, previously defined to beuniquely determined by its domain and name. We will treat entities with the same name anddomain in different segments as different entities, although they may represent the same externalentity. The unique identifier of an internal entity is now the triple[segment, domain, name]. A consequence of this redefinition of entities is that relations and domains do not span segments,either. Application programs must maintain any desired correspondence between entities, domains,or relations with the same name in different segments. We will return to this later. In the nextsection, we will discuss a more powerful but more complex and expensive mechanism, augments, inwhich the database system itself maintains the correspondence.]"ptFpt pjUG:spjSHjPDjMHjKJjImsp8jFes psp@jD0IjAdj?Ij=V j;^sp0'j9*!sp7j6 spsp< j4,j1Vj/aj-PR j+(7j(Gj"r jp:*jTbjspCjGjNjL jzEjFF` =j 56,jNj7rp jSspjd=s  M ?Q^< CYPRESS DATA MODEL CONCEPTS15We introduce three new operations to the data model in conjunction with segments:DeclareSegment[segment, file]: opens a segment with the given name, whose data isstored in the given file.GetSegments[] returns a list of all the segments which have been opened.SegmentOf[entity or relationship] returns the segment in which a given entity orrelationship exists. It may also be applied to relations or domains, since they are entities.With the addition of segments to the data model, we redefine the semantics of the basic accessoperations as follows:1.DeclareDomain and DeclareRelation take an additional argument, namely the segment inwhich the defined domain or relation will reside. The entity representing a domain orrelation now represents data in a particular segment.2.DeclareEntity and DeclareRelationship are unaffected: they implicitly refer to thesegment in which the respective domain or relation was defined. By associating a segment(and therefore a transaction and underlying file) with each relation or domain entityreturned to the database client, we conveniently obviate the need for additional argumentsto every invocation of the basic operations in the data model.3.DestroyEntity, DestroyRelationship, GetF, SetF, DomainOf, RelationOf, and Eq aresimilarly unaffected: they deal with entities and relationships in whatever segment they aredefined. Note that by our definition, entities in different segments are never Eq. Also notethat nothing in our definition makes a SetF across a segment boundary illegal (i.e.SetF[relationship, attribute, entity] where the relationship and entity are in differentsegments). Our current implementation requires that special procedures GetFR and SetFR be used onattributes that can cross segment boundaries, see Section 3.4.DomainSubset and RelationSubset are unchanged when applied to client-defined domainsor relations, i.e., they enumerate only in the segment in which the relation or domain wasdeclared. However an optional argument may be used when applied to one of the systemdomains or relations (e.g. the Domain domain), allowing enumeration over a specificsegment or all segments. RelationSubset's attribute-value-list arguments implictly indicate the appropriatesegment even for system relations, so a segment is not normally needed unless the entire relation isenumerated.Note that the data in a segment is stored in an underlying file physically independent from othersegments, perhaps on another machine. Introducing a file system into the conceptual data modelmay seem like an odd transgression at this point. From a practical point of view, however, we+]"ptpXtptpt;pUGQQkup!O6K[u p:Gu"p #EJT @M>g:u pup8V66"52Fu pup.0)0-+*+K)t>%u9 pup#dB!0=up @u&p2 tA^<pu pu p5N?@ J tT X p?"_d7' f >Q^<CYPRESS DOCUMENTATION16believe it better to view certain problems at the level of file systems. This point of view allowssegments to be used for the following purposes:1.Physical independence: Different database applications typically define their data inseparate segments. As a result one application can continue to operate although the datafor another has been logically or physically damaged. One application can entirely rebuildits database without affecting another, or an application can continue to operate in adegraded mode missing data in an unavailable segment.2.Logical independence: Different database applications may have information which pertainsto the same external entity, e.g. a person with a particular social security number. Whenone application performs a DestroyEntity operation, however, we would like the entity todisappear only from that application's point of view. Information maintained by otherapplications should remain unchanged. 3.Protection: Clients can trust the protection provided by a file system more easily than acomplex logical protection mechanism provided by the database system. An even higherassurance of protection can be achieved by physical isolation of the segment at a particularcomputer site. A more complex logical protection mechanism would be desirable for somepurposes, but was deemed beyond the scope of Cypress.4.Performance: Data may be distributed to sites where they are most frequently used. Forexample, personal data may reside on a client's machine while publicly accessed data resideon a file server. If the file system provides replication, it can be used to improveperformance for commonly accessed data.Concurrency control is handled by the file system. As noted earlier, information about an external entity may be distributed over multiple segments.One or more database applications may cooperate in maintaining the illusion that entities, domains,and relations span segment boundaries. This illusion may be used in at least two ways:1.Private additions may be added to a public segment by adding entities or relationships in aprivate segment. The new relationships may reference entities in the public segment bycreating representative entities with the same name in the private segment. An examplewould be personal phone numbers and addresses added to a public database of phonenumbers and addresses: an application program would make the two segments appear tothe user as one database.2.If two applications use separate segments A and B, they may safely reference each other'sdata yet remain physically independent. One of the applications may destroy andreconstruct its segment if it uses the same unique names for its entities. If both applications\ptFpt pjTcjR/N`sp@`LuF`JAJ`H I `E5A`sp"$`?L `=s p`;_&0`9*&5N`s p1`3F`0O `. I`,}5(`s pH`&l/,`$8E`"'j3jNj!BjW`*1`zF`FB` 6` 4``*spsp'` P`d@ M \?Q]CYPRESS DATA MODEL CONCEPTS17have relationships referencing an entity e, and application A does a DestroyEntity operationon e, the entity and relationships referencing it disappear from application A's point ofview, but application B's representative entity and relationships remain.5 ptpXtptpt6p)spspsp-sp dsp2ZI3 : TIMESROMAN  TIMESROMAN  TIMESROMAN  TIMESROMAN  TIMESROMAN HELVETICA  HELVETICA  HELVETICA  !&GNT2@ d ;o .-iP=O;]N=L;]L=I;]J%G9IEG=G#= |=5;]X%39W-3M1 =)]K=(Z$"9 :  %A9a9`E<"$bX9ZbX~bbd3b%S9Pbdbobd~bbd?bpbbb{~babbbbbbi~dCd>z􌻊bbb~bºazN~d>bbj/PtCypressDoc2.pressCattell15-Jun-83 9:46:44 PDT: