Jump to content

Navigational database

From Wikipedia, the free encyclopedia

Anavigational databaseis a type ofdatabasein whichrecordsorobjectsare found primarily by following references from other objects. The term was popularized by the title ofCharles Bachman's 1973Turing Awardpaper,The Programmer as Navigator.[1]This paper emphasized the fact that the new disk-based database systems allowed the programmer to choose arbitrary navigational routes following relationships from record to record, contrasting this with the constraints of earlier magnetic-tape and punched card systems where data access was strictly sequential.

One of the earliest navigational databases wasIntegrated Data Store(IDS), which was developed by Bachman forGeneral Electricin the 1960s. IDS became the basis for theCODASYLdatabase model in 1969.

Although Bachman described the concept of navigation in abstract terms, the idea of navigational access came to be associated strongly with the procedural design of the CODASYLData Manipulation Language.Writing in 1982, for example, Tsichritzis and Lochovsky[2]state that "The notion of currency is central to the concept of navigation." By the notion of currency, they refer to the idea that a program maintains (explicitly or implicitly) a current position in any sequence of records that it is processing, and that operations such asGET NEXTandGET PRIORretrieve records relative to this current position, while also changing the current position to the record that is retrieved.

Navigational database programming thus came to be seen as intrinsicallyprocedural;and moreover to depend on the maintenance of an implicit set of global variables (currency indicators) holding the current state. As such, the approach was seen as diametrically opposed to thedeclarative programmingstyle used by therelational model.The declarative nature of relational languages such asSQLoffered better programmer productivity and a higher level of data independence (that is, the ability of programs to continue working as the database structure evolves.) Navigational interfaces, as a result, were gradually eclipsed during the 1980s by declarative query languages.

During the 1990s it started becoming clear that for certain applications handling complex data (for example, spatial databases and engineering databases), the relational calculus had limitations. At that time, a reappraisal of the entire database market began, with several companies describing the new systems using the marketing termNoSQL.Many of these systems introduced data manipulation languages which, while far removed from the CODASYL DML with its currency indicators, could be understood as implementing Bachman's "navigational" vision. Some of these languages are procedural; others (such asXPath) are entirely declarative. Offshoots of the navigational concept, such as thegraph database,found new uses in moderntransaction processingworkloads.

Description

[edit]

Navigational access is traditionally associated with thenetwork modelandhierarchical modelofdatabase,and conventionally describes data manipulation APIs in which records (or objects) are processed one at a time, iteratively. The essential characteristic as described by Bachman, however, is finding records by virtue of their relationship to other records: so an interface can still be navigational if it has set-oriented features.[3]From this viewpoint, the key difference between navigational data manipulation languages and relational languages is the use of explicit named relationships rather than value-based joins:for department with name= "Sales", find all employees in set department-employeesversusfind employees, departments where employee.department-code = department.code and department.name= "Sales".

In practice, however, most navigational APIs have been procedural: the above query would be executed using procedural logic along the lines of the following pseudo-code:

get department with name='Sales'
get first employee in set department-employees
until end-of-set do {
get next employee in set department-employees
process employee
}

On this viewpoint, the key difference between navigational APIs and therelational model(implemented inrelational databases) is that relational APIs use "declarative" orlogic programmingtechniques that ask the systemwhatto fetch, while navigational APIs instruct the system in a sequence of stepshowto reach the required records.

Most criticisms of navigational APIs fall into one of two categories:

  • Usability: application code quickly becomes unreadable and difficult to debug
  • Data independence: application code needs to change whenever the data structure changes

For many years the primary defence of navigational APIs was performance. Database systems that support navigational APIs often use internal storage structures that contain physical links or pointers from one record to another. While such structures may allow very efficient navigation, they have disadvantages because it becomes difficult to reorganize the physical placement of data. It is quite possible to implement navigational APIs without low-level pointer chasing (Bachman's paper envisaged logical relationships being implemented just as in relational systems, using primary keys and foreign keys), so the two ideas should not be conflated. But without the performance benefits of low-level pointers, navigational APIs become harder to justify.

Hierarchical models often construct primary keys for records by concatenating the keys that appear at each level in the hierarchy. Such composite identifiers are found in computer file names (/usr/david/docs/index.txt), in URIs, in theDewey decimalsystem, and for that matter in postal addresses. Such a composite key can be considered as representing a navigational path to a record; but equally, it can be considered as a simple primary key allowing associative access.

As relational systems came to prominence in the 1980s, navigational APIs (and in particular, procedural APIs) were criticized and fell out of favour. The 1990s, however, brought a new wave ofobject-oriented databasesthat often provided both declarative and procedural interfaces. One explanation for this is that they were often used to represent graph-structured information (for example spatial data and engineering data) where access is inherently recursive: the mathematics underpinning SQL (specifically,first-order predicate calculus) does not have sufficient power to support recursive queries, even those as simple as atransitive closure.

A current example of a popular navigational API can be found in theDocument Object Model(DOM) often used in web browsers and closely associated withJavaScript.The DOM is essentially an in-memory hierarchical database with an API that is both procedural and navigational. By contrast, the same data (XMLorHTML) can be accessed usingXPath,which can be categorized as declarative and navigational: data is accessed by following relationships, but the calling program does not issue a sequence of instructions to be followed in order. Languages such asSPARQLused to retrieveLinked Datafrom theSemantic Webare also simultaneously declarative and navigational.

Examples

[edit]

See also

[edit]

References

[edit]
  1. ^Bachman, Charles W. (1973)."The programmer as navigator".Communications of the ACM.16(11). Portal.acm.org: 653–658.doi:10.1145/355611.362534.S2CID18635540.
  2. ^Dionysios C. Tsichritzis and Frederick H. Lochovsky (1982).Data Models.Prentice-Hall. p.67.ISBN0-13-196428-3.
  3. ^Błażewicz, Jacek; Królikowski, Zbyszko; Morzy, Tadeusz (2003).Handbook on Data and Management in Information Systems.Springer. p. 18.ISBN3-540-43893-9.
[edit]