You are on page 1of 9

Real Time System Real time systems are used in real time applications where rigid time requirements

required for the completion of the operation. In real time systems apart from the correctness of the computation of the results, the response time is also a critical factor. The system should react correctly and timely according to the situation. The real time systems are classified into hard real time system and soft real time system.

DBMS hides the internal complexities from the application programs that use the database.

File Processing System A File can store records and we can extract these records using different applications programs.

The simplest data retrieval task from file require extensive programming. Also this is a time consuming and a high skill activity.

 

Hard Real Time System Soft Real Time System

 

To access the data in file the programmer must aware of the physical structure of the file. Security features such as effective password protection, locking parts of file etc are very difficult to program.

A hard real time system guarantees that critical task must complete on time, that is it ensures that tasks are performed with in the deadline deterministically. In Soft real time, computing is less restrictive as compared to hard real time system. It requires that critical processes must get priority over less priority ones. Database Management System

The File system exhibits structural dependence. That is a change in file structure such as addition or deletion of a field require the modification of all programs using that file.

A Database Management System is a collection of interrelated data and a set of programs to

Data dependence: A change in file data characteristic such as change in a field data type from integer to decimal, requires changes in all programs that access the file.

access to those data.  The collection of Data is referred as Database.  The primary goal of a Database Management System(DBMS) is to provide a way to store and retrieve database information that is both convenient and efficient. Data are very important in any information system. So we must have a very good way of managing such data. The DBMS contain a query language that makes it possible to give quick and exact answers to adhoc queries. The DBMS helps to create an environment in which users have better access to data. Such access makes it possible for end users to respond more quickly and efficiently to changes in their environment. DBMS helps to give an integrated view of the organization’s operations. Thus it becomes much easier to see how operations in one unit affect others. Data inconsistency is considerably reduced in a properly designed database. Database systems are designed to manage large volume of information. Data management involves both defining the structure for storage of information and providing mechanism for the manipulation of data. Also the database system must ensure the safety of the information stored. The DBMS makes it possible to share the data in the database among multiple applications and users. DBMS serves as the intermediary between the database and the user by translating user request to the database and getting back exact responses to the user. Also the

A typical file processing system is supported by conventional operating systems. The system stores permanent record in various files. It uses various application programs to extract records from, and add records to the appropriate files. Before using DBMS to store and retrieve data, organizations stored information in file processing systems. But as the number of files in the system expands, system administration becomes difficult too. Each file must have its own file management system, composed of programs that allow user to create the file structure, add data to the file, delete data from the file, modify the data in the file, list the file contents etc. Even a simple file processing system containing 25 files requires 5 * 25 =125 file management programs. Each department in the organization owns its data by creating its own files. So the number of files can multiply rapidly. Security features such as effective password protection, locking out part of files or part of system itself and other data confidentiality measures are difficult to program and are usually omitted. The file system’s structure and lack of security makes

That means different versions of same basic data are existing. But in database we can declare the integrity constraints along with definition itself.it difficult to pool data.For example transferring $100 from Account A to account B. and application programs and utilities. management. This results in concurrent access anomalies. It includes computers. Operating System DBMS Software Application Programs and Utilities The operating System manages all the hardware components and makes it possible for all other . Security Problems Enforcing Security Constraints in file processing system is very difficult as the application programs are added to the system in an ad-hoc manner. But it is very unlikely that that data stored in different locations will always be updated consistently. In file processing system it is very difficult to handle this using program code. Convenient and efficient information retrieval is almost impossible using conventional file processing system. Data Redundancy Data Redundancy means same information is duplicated in several files. DBMS Software. Concurrent Access anomalies If multiple users are updating the same data simultaneously it will result in inconsistent data state. Integrity Problems The data values may need to satisfy some integrity constraints. computer peripherals. Difficulty in Accessing Data It is not easy to retrieve information using a conventional file processing system. writing new application program to retrieve data is difficult. This makes data redundancy. hence maintaining different versions of same data. It includes the operating system. This occurs as the result of update operations that are not updating the same data stored at different places. Software Components in a Database System Environment Software refers to the collection of programs used with in the database system. Example: Address Information of a customer is recorded differently in different files. and use of data with in a database environment. The same basic data is stored in different locations. Disadvantages of File Processing System The conventional file processing system suffers from the following shortcomings:         Data Redundancy Data Inconsistency Difficulty in Accessing Data Data Isolation Integrity Problems Atomicity Problem Concurrent Access anomalies Security Problems Database System Environment The term database system refers to an organization of components that define and regulate the collection.If a failure occurs during execution there could be situation like Php100 is deducted from Account A and not credited in Account B. storage. The file processing system is simply not suitable for modern data management and information requirement Atomicity Problem It is difficult to ensure atomicity in file processing system.      Hardware Software People Procedures Data Hardware Components in a Database System Environment Hardware identifies all the system's physical devices. For example the balance field Value must be grater than 5000. Data Isolation Data are scattered in various files. We have to handle this through program code in file processing systems. Data Inconsistency Data Inconsistency means different copies of the same data are not matching. and the files may be in different format. network components etc. In a high level view the database system is composed of the following five major parts.

data types.This information is termed as metadata. integrity constraints etc. Backup and Recovery Management The DBMS provide backup and data recovery procedures to ensure data safety and integrity. Hence the database ensures data integrity and data consistency. In short the DBMS provides data abstraction and it removes structural and data dependency from the system. The DBMS formats the physically retrieved data according to the logical data format specifications. LINUX. They create the input screens. DBMS system provide special utilities which allow the DBA to perform routine and special backup and restore . Database Administrators. Oracle Corporation's ORACLE. relationship between data. Application programs and utilities software are used to access and manipulate the data in the database and to manage the operating environment of the database. Sun's MYSQL. the employees. System Analysts and programmers design and implements the application programs. People in a Database System Environment People component includes all users associated with the database system. reports. DBMS software manages the database with in the database system. IBM's DB2. The users are freed from defining.ER model represent the conceptual design of an OLTP application. Security rules determine the access rights of the users. On the basis of primary job function we can identify five types of users in a database system: System Administrators. System Administrators Data Modelers Database Administrators System Analysts and Programmers End Users System Administrators oversees the database system's general operations.Hence the DBMS translate logical request into commands that physically locate and retrieve the requested data. Security Management The DBMS creates a security system that enforces user security and data privacy within the database. Microsoft Windows etc are the popular operating systems used in database environment. Data Transformation and Presentation DBMS supports data independence. Data Modelers (Architect) prepare the conceptualdesign from the requirement. and procedures through which end users access and manipulate the database.software to run on the computers. Microsoft's MS Access and SQL Server etc are the popular DBMS (RDBMS) software used in the database environment. Procedures in a Database Environment Procedures are the instructions and business rules that govern the design and use of the database system.          Data Dictionary Management Data Storage Management Data Transformation and Presentation Security Management Multi User Access Control Backup and Recovery Management Data Integrity Management Database Access Languages and Application Interface Database Communication Interface Data Dictionary Management The data dictionary stores the definitions of data elements and their relationships. It is the collection of facts stored in the database. Database Management System Functions The Database Management System performs the following functions.The metadata includes definition of data.System Analysts and Programmers and End Users. UNIX.programming and implementing the complex physical data characteristics. Any changes made in a database structure are automatically reflected in the data dictionary. The DBA performs the physical implementation and maintenance of a database system. End Users are the people who use the application. Read/write access is given to the user is specified using access rights. Database Administrator (DBA) physically implements the database according to the logical design. customer using ATM or online banking facility are end users. Data Storage Management The DBMS creates the complex structures required for data storage. Multiuser Access Control The DBMS ensures that multiple users can access the database concurrently without compromising the integrity of the database. Data in the Database Data are the very important basic entity in a database. For example incase of a banking system. Data Modelers.

A query language is a non-procedural language. Constraints) by a set of definition expressed by a language called DDL. Declarative DML (Non Procedural DML): In declarative Data manipulation language user has to specify what data are needed without specifying how to get it.This information (meta data) is stored in the data dictionary. Example : SQL (Structured Query Languages) Data Definition Language 1. Data manipulation is Retrieval of Information Stored in Database Insertion of Information to the database Deletion of information from the database Updating of information stored in the databas A query language is a portion of a DML involving information retrieval only. 2. 2. The terms DML and query language are often used synonymously. The DBMS's query language contains two components: a data definition language(DDL) and a data manipulation language(DML). This DDL statement creates a table student with fields SNAME and ROLLNO. Recovery Management deals with the recovery of the database after a failure. Data Types . Database Communication Interfaces Different users may access the database through a network environment. Procedural DML: In procedural Data manipulation language user has to specify what data are needed and how to get it. There are two types of DML: o procedural: the user specifies what data is needed and how to get it o nonprocedural: the user only specifies what data is needed  Easier for user  May not generate code as efficient as that produced by procedural languages Data Definition Language (DDL) We specify the database schema (Data fields .procedures. resulting in a set of tables stored in a special file called a data dictionary or data directory. 4. The data directory contains metadata (data about data) The storage structure and access methods used by the database system are specified by a set of definitions in a special type of DDL called a data storage and definition language basic idea: hide implementation details of the database schemes from the users 3. The DBMS also provide data access to programmers via programming languages. Used to specify a database scheme as a set of definitions expressed in a DDL DDL statements are compiled. Data Manipulation Language (DML) Data Manipulation Language (DML) is used for data manipulation. Database Manager 1. The database manager is a program module which provides the interface between the low-level data stored in the database and the application programs and queries submitted to the system. 5. that is the user only need to specify what must be done without specifying how it is to be done. So the DBMS provide communication functions to access the database through computer network environment. Data Manipulation is: o retrieval of information from the database o insertion of new information into the database o deletion of information in the database o modification of information in the database The goal is to provide efficient human interaction with the system. ROLLNO CHAR(10)). Data Integrity Management The DBMS promotes and enforce integrity rules to eliminate data integrity problems. Example: CREATE TABLE student(SNAME CHAR(10). Database Access Languages and Application Interface The DBMS provides data access via query language. thus minimizing the data redundancy and maximizing data consistency. Types of Data Manipulation Language (DML) Procedural DML Declarative DML (Non Procedural DML) . Database Languages Data Definition Language (DDL) Data Manipulation Language (DML) Data Manipulation Language (DML) 1.

.. Schema and physical organization modification The DBA carries out changes to the existing schema . Ordinary users might have highly restricted access to data.Heaps. o Sophisticated users interact with the system without writing programs. Granting authorization for data access. etc.) These features are necessary on larger system Functions of a Database Administrator One of the main reasons for using DBMS is to have a central control of both data and the programs accessing those data. o Specialized users are sophisticated users writing special database application programs. Ensure that performance is not degraded by some expensive task submitted by some users. Storage structure and access method definition Database tables or indexes are stored in the following ways: Flat files. Performance is important. resulting in simpler database managers. retrieving and updating data in the database).  These are sometimes called fourthgeneration languages.  They often include features to help generate forms and display data. PL/1.length of attributes. These may be CADD systems. #. Schema includes the logical structure of database table(Relation) like data types of attributes.  The DML precompiler converts DML calls (prefaced by a special character like $. no bank account balance below $25) o Security enforcement: Ensuring that users only have access to information they are permitted to see o Backup and recovery: Detecting failures due to power failure. complex data systems (audio/video). software errors. no concurrency is required on a PC running MS-DOS. Data is moved between disk and main memory (MM) as needed. Performance Tuning Database Users 1. Routine Maintenance Some of the routine maintenance activities of a DBA is given below. etc. This must be stored on disks.2. and restoring the database to its state before the failure o Concurrency control: Preserving data consistency when there are concurrent users. Monitoring jobs running on the database. knowledge-based and expert systems.  Some special types of programming languages combine Pascal-like control structures with control structures for the manipulation of a database. The goal of the database system is to simplify and facilitate access to data. (For example. o Naive users are unsophisticated users who interact with the system by using permanent Some small database systems may miss some of these features.g.B+ Tree etc. The database users fall into several categories: o Application programmers are computer professionals interacting with the system through DML calls embedded in a program written in a host language (e. etc.you will get more access rights. Databases typically require lots of storage space (gigabytes).g. So the database manager module is responsible for o Interaction with the file manager: Storing raw data on disk using the file system usually provided by a conventional operating system. Taking backup of database periodically Ensuring enough disk space is available all the time.  The host language compiler then generates the object code. 3. The following are the functions of a Database administrator     Schema Definition Schema and physical organization modification.) to normal procedure calls in a host language. C.  These programs are called application programs. Routine Maintenance Schema Definition The Database Administrator creates the database schema by executing DDL statements. disk crash. A person who has such control over the system is called a Database Administrator(DBA). 4. o Integrity enforcement: Checking that updates in the database do not violate consistency constraints (e. Views provide simplification. and physical organization.  They form requests by writing queries in a database query language  These are submitted to a query processor that breaks a DML statement down into instructions for the database manager module. The database manager must translate DML statements into low-level file system commands (for storing.integrity constraints etc. Granting authorization for data access The DBA provides different access rights to the users according to their level. Pascal). while you go up in the hierarchy to the administrator .

The precompiler interacts with the query processor.  All copies may not be updated properly.  Generate monthly statements. 2. but over a long period of time files may be in different formats.  Need protection for concurrent updates.  Find an account balance.  Difficult to write new application programs.  E.00. Great emphasis should be placed on developing a good design and efficient implementation of the dictionary.  Add a new account. find all customers with the same postal code. Data dictionary: stores information about the structure of the database.g. and cannot see customer accounts. To see why database management systems are necessary.application programs (e.  E.g.g.. $400 or $450 if no protection. but a long job.account has $500 in it. Some functions (e.  E. several data structures are required for physical system implementation: 2.  E.. automated teller machine Overall System Structure 3. tellers only access account data and cannot see payroll data. The application is a savings bank: Savings account and customer records are kept in permanent system files. and o Application programs may be in different languages. . New permanent files are created as required. o Data isolation  Data in different files. payroll people only handle employee records. o Difficulty in accessing data  May have to write a new application program to satisfy an unusual request. difficult to enforce or to change constraints with the file-processing approach. two customers withdrawing funds from the same account at the same time . o Security problems  Every user of the system should be able to access only the data they are permitted to see. o Application programs are written to manipulate files to perform the following tasks:  Debit or credit an account. o DDL compiler converts DDL statements to a set of tables containing metadata stored in a data dictionary. Development of the system proceeds as follows: o New application programs must be written as the need arises. file systems) may be provided by the operating system. o o Data files: store the database itself. Components include: o File manager manages allocation of disk space and data structures used to represent information on disk. (May also attempt to find an equivalent but more efficient form. Database systems are partitioned into modules for different functions. o Query processor translates statements in a query language into low-level instructions the database manager understands. o Integrity problems  Data may be required to satisfy constraints.  Difficult to enforce this with application programs.g. let's look at a typical ``file-processing system'' supported by a conventional operating system.g. So we can see there are problems with the straight fileprocessing approach: o Data redundancy and inconsistency  Same information may be duplicated in several places. o o o These problems and others led to the development of database management systems. Purpose of Database Systems 1. no account balance below $25.  Again. In addition. 1. Indices: provide fast access to data items holding particular values. The result could be $350.g. and they withdraw $100 and $50.  Could generate this data manually.  Data in different formats.) o DML precompiler converts DML statements embedded in an application program to normal procedure calls in a host language. o Database manager: The interface between lowlevel data and application programs and queries. It is used heavily. o Multiple users  Want concurrency for faster response time.

o Another essential element of the E-R diagram is the mapping cardinalities. 2. .  Infological model. these values are themselves objects. the instance variables and method code. There are several levels of abstraction: 1. o Over 30 such models. o A relationship is an association among several entities.  Object-oriented model. 3. o Analogy: the programming language concept of an abstract data type. we'll take a closer look at the entityrelationship (E-R) and object-oriented models 2. Object-based Logical Models 1. o lines: link attributes to entity sets and entity sets to relationships E. Record-based Logical Models.g. o Unlike the record-oriented models. hashing. index. o e. The object-oriented model is based on a collection of objects. We'll see later how well this model works to describe real world situations. o An object contains values stored in instance variables within the object. o diamonds: represent relationships among entity sets. Conceptual Level:  Next highest level of abstraction. The E-R Model 1.Data Abstraction 1. A cust_acct relationship associates a customer with each account he or she has.  Binary model. o ellipses: represent attributes. o Thus objects contain objects to an arbitrarily deep level of nesting. data relationships.  Complex low-level structures described in detail. The major purpose of a database system is to provide users with an abstract view of the system.  Describes what data are stored.  Lowest level of abstraction. o An entity is a distinguishable object that exists.g. number and balance for an account entity. At this point. 2. 3. including  Entity-relationship model.  Can be many different views of a database.g. Physical Level:  How the data are stored. o E. data semantics and data constraints.  Semantic data model. B-tree. but not of payroll data DATA MODELS 1. The system hides certain details of how data is stored and created and maintained Complexity should be hidden from database users.  Describes part of the database for a particular group of users. The entity-relationship model is based on a perception of the world as consisting of a collection of basic objects (entities) and relationships among these objects. o A class may be viewed as a type definition for objects. Physical Data Models The Object-Oriented Model 1. like the E-R model.g. 2. o Allow one to specify data constraints explicitly. are not visible externally. o These bodies of code are called methods. o Provide fairly flexible structuring capabilities. which express the number of entities to which another entity can be associated via a relationship set. Object-based logical models: o Describe data at the conceptual and view levels. The overall logical structure of a database can be expressed graphically by an E-R diagram: o rectangles: represent entity sets. o Objects that contain the same types of values and the same methods are grouped into classes.  Database administrator level. There are three different groups: 1.  E. o Each entity has associated with it a set of attributes describing it. Object-based Logical Models.  Functional data model. o The set of all entities or relationships of the same type is called the entity set or relationship set. o This is called sending a message to the object. o The only way in which one object can access the data of another object is by invoking the method of that other object. Data models are a collection of conceptual tools for describing data. View Level:  Highest level. o An object also contains bodies of code that operate on the the object. 2. o Internal parts of the object. tellers in a bank get a view of customer accounts.  Describes the relationships among data.

o Separate languages associated with the model are used to express database queries and updates. Unlike entities in the E-R model.3 shows a sample relational database . are used to  Specify overall logical structure of the database. o Result is two levels of data abstraction. Organization of the records is as a collection of trees. Physical Level Logical Level View Level   Data and relationships are represented by a collection of tables. o Unlike object-oriented models. corresponding to levels of abstraction: o Physical scheme o Conceptual scheme o Subscheme (can be many 5.g. 3. o Unifying model. The Relational Model Data Independence A major purpose of a database system is to provide the users with an abstract view of data. o Each field is usually of a fixed length (this simplifies the implementation). 2. 4. o Named so because the database is structured in fixed-format records of several types. o The network and hierarchical models are covered in appendices in the text 1. 3. independent of the values it contains: o Two objects containing the same values are distinct. Instances and Schemes 1. o The object contains a method pay-interest which adds interest to the balance.instance There are several schemes. Each table has a number of columns with unique names. The Network Model    Data are represented by collections of records. this only entails a change within the pay-interest method. o This course will concentrate on the relational model. or attributes. The Hierarchical Model   Similar to the network model. o Under most data models. and hierarchical. customer. o The three most widely-accepted models are the relational. The information in a database at a particular point in time is called an instance of the database. Are used to describe data at the lowest level. changing the interest rate entails changing code in application programs. consider an object representing a bank account. Record-based logical models: o Also describe data at the conceptual and view levels. o Distinction is created and maintained in physical level by assigning distinct object identifiers. Relationships among data are represented by links. o In the object-oriented model. o Frame memory.g. e. To hide the complexity from users database apply different levels of abstraction. rather than arbitrary graphs Record-based Logical Models Physical Data Models 1. e. o The object contains instance variables number and balance. Analogy with programming languages: o Data type definition . and  Provide a higher-level description of the implementation. 2. The following are different levels of abstraction. o Record-based models do not include a mechanism for direct representation of code in the database. Figure 1. Very few models. For example. o Each record type defines a fixed number of fields.scheme o Value of a variable . account. The overall design of the database is called the database scheme. each object has its own unique identity.2. We will not cover physical models. network. Organization is that of an arbitrary graph. Databases change over time.

The process is repeated until the end users and designers agree that the E-R diagram is a fair representation of the requirement. At the view level users see a set of application programs that hide details of data types. In other words.All entities in an entity set have the same set of attributes. It provides different view to different users. The ER model is very expressive so that people can easily understand the requirement. DBA etc knows the logical structure of data View Level This the highest level of abstraction. The ER Model is used at the conceptual design stage of the database design. For example 'Person' in an organization is an entity. Each oval contains the name of the attribute it represents. This is called logical data independence. The relationship name (an active or passive verb). one-to-many. book etc or may be abstract such as account. is written inside the diamond. many-tomany. The details such as data type etc are not available at this level. Attributes and Relationships. relation between data. Thus entity set is a set of entities of the same type that share the same properties or attributes. Database programmers. Logical Data Independence The changes in the logical level do not affect the view level. At the E-R modeling level an entity actually refers to an entity set.loan etc. Relationships are represented by a diamond connected to the related entities.  Relationships Entitie An entity is a thing or object in the real world that is distinguishable from all other objects. which is a noun usually written in capital letters. An Entity is an object that exist in the real world and is distinguishable from other entities. The data modeler prepares the ER diagram and is verified with the functional domain experts to ensure that all the requirements are properly incorporated in the conceptual design. An entity has a set of properties. Only view or Access is given to a part of data according to the users access right Physical Data Independence The changes in Physical Level does not affect or visible at the logical level. The basic constructs of ER Model are Entity. Database Administrators may be aware of certain details of physical organization of data. Attributes An entity is represented by a set of attributes. The ER model refers to a specific table row as an entity instance or entity occurrence.   Entity Entity Set An entity may be concrete such as a person. Attributes are represented by ovals and are connected to the entity with a line. We can easily map an ER diagram to a relational schema. entity in ER model corresponds to a table. This is called physical data independence.     Conceptual Design ER Diagram Entities Attributes . Collection of similar entities (Entity Set) often corresponds to a table. Each entity set has a key. types of data etc . The requirement analysis is modeled in this conceptual design.ER diagram is used to represent this conceptual design. In ER model the association among entities is described as one-to-one. Entity Relationship Model (E-R Model) The process of database design is an iterative process. Relationships A relationship describes an association among entities. An entity is represented by a rectangle containing the entity name. Logical Level This is the next higher level of abstraction which describe what data are stored in database.For each attribute there is a set of permitted values called the domain or value set of the attribute.The database system hides many of the lowest level storage details from the database programmers.Physical Level Physical Level is the lowest level of abstraction and it defines the storage structure. It corresponds to a field in a table.The physical level describes complex low level data structures in detail.