Wednesday, January 21, 2009

Relational Database Model

Introduction

Inherent limitations of the Hierarchical and Network database models slowly led (with the advent of microcomputer systems) to the increased popularity of Relational database models. Dr. E.F. Codd, who invented the Relational model in the early 1970's while heading a research project sponsored by IBM, based the new model on principles of relational algebra in order to solve problems associated with storing large volumes of data. The fundamental improvements in the Relational model are founded upon the design principles of the table, in which all the data is stored. In the Relational model, each table has a unique name, so that all the user needs to know is the name of the table, and not where or how the data is stored. In traditional databases, by contrast, you would have had to understand how the database was structured, in order to reach the sought-after data. By contrast, now to find the table or data you are looking for in the Relational model, you use a new, specialized language, called Structured Query Language (SQL), in order to "talk" to the database; for example, you can now type a command essentially asking the database to show you all the rows in the video table. This methodology has made the understanding and functionality of database principles easier and more accessible, and, hence, more popular. Furthermore, database administration is now a lot easier, too. Tables in this model can be used not only for storing the actual data, but also for managing access rights to the database; thereby, ensuring data integrity. Everything in the Relational model can be stored in tables. Today, the Relational model has been implemented in a large number of databases, also known as Relational Database Management Systems (RDBMS).
The Relational database model, thus presents the following advantages:



  • Ease of Understanding: data is stored in a way that even end-users understand at least at the conceptual level;

  • Visible Relationships: the relationships between entities are clearer, no longer embedded or hidden from the end user;

  • Data Independence: modifications may be made to the data without making global modifications to the application's structure.
The Relational database stores its data using, of course, what is known as the Relational model. In a Relational database, the data is stored in a set of related tables. The term relational is used because relationships are established between multiple tables. A system that manages a Relational database is referred to as a Relational Database Management System (RDBMS). The data contained in such a database is stored across several tables. To access and manipulate this data, a user types in (or enters) specific commands in a language understood by the database. Structured Query Language (or SQL) is one of the languages used to communicate with Databases.


Object-Relational Database Management Systems

Over the last two decades, a new style of programming has developed, called Object-Oriented Programming (OOP), which differs significantly from traditional programming. Basically, data structures processed by OOP are much more complex than those processed by traditional programming languages. OOP data structures more accurately approximate real-world entities and thus help in representing data as it actually exists in the real world. Because these data structures have remained difficult to incorporate into existing relational DBMS products, a new category of DBMS products, called object-oriented database systems, have evolved, and continue to evolve. They provide certain significant advantages over RDBMS's.
Oracle has extended its RDBMS model to an Object-Relational model, which makes it possible to store object data structures within the Relational model. The Object-Relational model allows users to create user-defined data structures (called object types) and to apply them within the Relational model.
In ORDBMS, users themselves are free to define additional kinds of data types in ways which specify both the structure of the data and the ways of operating (methods) on it. This flexible approach adds value to the data stored in the database because, again, both the structure of the data and the ways of operating on it can be independently specified.
Such user-defined data types are therefore termed object types.
Let us consider a purchase order system. Its tables may contain such data as customer, item, purchase order, etc. The application would need dynamically created status information about the purchase order, such as current value of the shipped or unshipped items, and the total money value of a purchase order. For this, we would normally have to create some sort of data logic within the application (e.g., with triggers), but now, in an ORDBMS, we can simply define the purchase order itself as a datatype (called an object type). This object type will specify those attributes that make up the purchase order and will also specify the operations (called methods) we perform on the data unit or object type (i.e., the purchase order), such as determining the total money value of an individual purchase order. The application thus will not be required to calculate the total value of the purchase order since the logic of the purchase order's structure and behavior is already included in the database schema. The application will no longer need to know the details and thus will not need to keep up with most changes.
So, by using object types, the application need only contain application logic not data logic.


Object Types

An object type is a user-defined data type which encapsulates the data structure along with the operation needed to manipualte it. An object type represents a real-world entity such as a car dealer, employee, and address. By using object types, programs can better reflect the world they seek to emulare.

An object type has three components:

  • Name -- the name of the object type
  • Attribute -- characteristics representing the structure of the real-world entity
  • Methods -- representating behaviours of the real-world entity, and operations the applacation can perform on the real-world entity

OJO: Object types are analogous ti IC's that can be plugged into various electronic devices. To plug an object type into your program, you need only know what it does, not how it works.

Advantages of an Object-Relational Model over Strictly Relational Model

  • An ORDMS by design bundles the data structure with the operation performed on it. Consequently, the application is no longer burdened with variations on how to operate on the data object. For instance, in the purchase order example, the application need not write code to calculate the sum of the line items in order to calculate the total cost to the customer. By contrast, while an RDBMS provides a very efficient way of storing and retrieving data, every application developer must first write the necessary code for an operation to be performed on the data.
  • Because object types store data in its more natural form and allow applications to retrieve it that way, ORDBMS better represents the real world.
    Since the logic of the object type's structure and behavior is contained within the database schema itself, application logic need not account for most details nor track most changes. Thus, an application need only contain application logic and not data logic.
  • Object types can be used across applications, allowing users to be concerned with only what they do, not how they do it.
  • User-defined types make it much easier to work with multimedia data such as sound, video, graphics, etc.
  • The ORDBMS approach greatly enhances transmission efficiency. For example, a client-side application can request a purchase order from the server and receive all relevant data in a single transmission.



No comments:

Post a Comment