Bring iT

Sunday, June 29, 2008

RDBMS : Functional Components of a Database Management System

A database management system comparises many modules each dealing with a specific responsibility of the overall system. The functional components of a database management system are :

a. Database Manager
The database manager is the central software component of a DBMS. It is responsible for converting users queries to appropriate system calls. It maintains the consistency and integrity of the database and enforces data security. It also synchronizes the simultaneous operations performed by concurrent users. Apart from these, it also handles backup and recovery operations.

b. File Manager
The file manager services all requests for data. It identifies the block containing the requested record. The block is then requested from the disk manager. The file manager selects the requested record from the block and transmits it to the database manager. The file manager is also responsible for managing storage space and structures.

c. Disk Manager
The disk manager performs all the physical input and output. It interacts with the file manager and does read or write on the storage device as requested by the file manager. It views all data as row data. The operations performed by the disk manager are :
 Retrieves blocks of data
 Replaces blocks of data
 Removes blocks of data

RDBMS : Recovery From Deadlock

Once it is determined that a deadlock exitx, the system needs to recover from the deadlock. For this, one or more transactions are rolled back to break the deadlock. While performing the roll back operation, the following issues need to be addressed :

a. Selection of a victim : in the situation of a deadlock, you first need to determine the transaction (or transaction) that should be rolled back to break the deadlock. Such a transaction is called the victim transaction. The transaction that will lead to minimum loss, in terms of cost, should be chosen for rollback. The following factors determine the cost of a rollback :
 How much execution has the transaction completed and for how much more time the transaction will execute to complete its task?
 How many data items were used by the transaction?
 How many more data items does the transaction need to complete?
 How many transaction will be included in the rollback?

b. Rollback : after determining the transaction to be rolled back, you need to determine how far the transaction is to be rolled back. The easlest answer to this problem is to do a total rollback, which means that the transaction will be aborted and restarted. However, it is better to roll back the transaction only till the point where the deadlock can be broken. This method requires the DBMS to maintain information about all current transaction.

c. Starvation : when the selection of a victim is based on cost factors, it might happen ihat the same transaction is selected as a victim every time a deadlock occurs. Due to this, the transaction might not be able to complete its task. Such a situation is called starvation. To avoid starvation, you need to ensure that a transaction is picked as a victim for only a fixed number of times. To ensure this, you can select a victim based on the number of rollbacks along with the cost factor.

Friday, June 27, 2008

RDBMS : Benefit of Database Management System



A major advantage that the database approach has over the conventional approach is that a database management system provides centralized of data.

Following are some of the benefits of the database approach :

a. Redudancy is reduced : in the database approach, applications do not have to maintain their own data file. The same course data file is used by the course scheduling application, the instructor scheduling application, and the semester planning application.

b. Inconsistency is avoided : because redundancy is reduced, inconsistency is also avoided. Consider a situation where ten students have enrolled for a course. This information is stored in the student data file. The other applications will use the same student file and therefore, no inconsistency can occur. If this information is recorded in more than one place, inconsistency can occur, as changes made in one data file may not get reflected in another data file.

c. Data is shared : while the existing applications can share data in the database, new applications can also be developed that will use the same database.

d. Standards are enforced : with centralized control of data, the DBA can ensure that standards are maintained in stored data formats. This is particularly useful for data interchange, or migration of data between two systems.

e. Security restrictions are applied : the DBA eensures that only authorized persons have access to the database. The DBA defines the security checks to be carried out. Differenet checks can be applied to different operations on the same data. For instance, a person may have access to query a file, but may not have the right to delete or update that file.

f. Integrity is maintained : inconsistency between two entries can lead to integrity problems. Even without redundancy, the database can still be inconsistent. For example, a student enrolls in 10 courses when the maximum number of courses a student can enroll is seven. Or, a student enrolls in a course that is not being offered in that semester. Such problems can be avoided in a DBMS by establishing certain integrity checks that are performed with any update operation.

RDBMS : Introduction of DBMS

A database is a collection of records. One of the major tasks in a computer system is to store and manage data. To handle this task, you need a specialized computer software known as a database management system (DBMS). Database management systems are design to maintain large volumes of data. Management of data involves :

a. Defining structures for data storage
b. Providing mechanism for data manipulation
c. Providing data security against unauthorized access

Database management system are now available on a wide range of computer, from desktops to mainframes. The size and power of the computer determine the system facilities, such as security and storage.

A single-user system allows only one person to access a database at any given time. In a multi-user system, several users can access a database simultaneously.

With the increasing power of desktop computer, multi-user database systems are now available that support a small group of users to connect these desktop computers and access data concurrently. These database systems can be scaled up to support hundreds or thousands of users, depending on the configuration of the hardware on which the database system is running.

The main objectives of any DBMS are to :

a. Provide an efficient and convenient environment that is used to store data in, and retrieve data from a database.
b. Manage information about users who interact with the DBMS and the activities that these users can perform on the data.