By N.RAJINI KIRANMAI Lecturer Computer Science Dept, SJDC What is DATA? Data vs. Information Data: Collection of figures (letters), numbers & facts which when considered as such doesn't have any meaning. Information: Processed data that has a meaning. DIFFERENCES BETWEEN DATA & INFORMATION BASIS FOR COMPARISION DATA INFORMATION Data means raw facts gathered about someone or something, which is bare and random. Facts, concerning a particular event or subject, which are refined by processing is called information Format It is just text and numbers. It is refined data. Based on Records and Observations Analysis Form Unorganized Organized Useful May or may not be useful. Always Dependency Does not depend on information Without data, information cannot be processed. Meaning DATABASE and DBMS Data Base A repository of data or collection of data about one particular enterprise DBMS (Data Base Management System) DB + set of programs that access those data Data Base System: System which manages DB is called Data Base System Managing = Structure definition + Manipulation Mechanism Why a DBMS? • Security • Can handle many users with good performance • Allows for concurrency while keeping data consistent • Protects from disaster FILE BASED SYSTEM FILE: A collection of related records is called file. RECORD: A logically connected set of one or more fields that describes a person, place or things is called a Record. FIELD: A character or group of characters that have a special meaning is called field. A field is used to define & store data. In earlier information system or File processing System, information is stored on System Files. System Files are the permanent files developed by the system programmer, when the original system was designed. The mechanism provided to manipulate the information stored in the system files is writing the Application Programs. FILE BASED SYSTEM Savings Bank Enterprise Information about all customers and savings account stored in a permanent files. Number of Application programs that manipulate the files are A program to debit or credit an account. A program to add a new account. A program to find the balance of an account. A program to generate monthly statements. These Application programs have been written by the system programmers in response to the needs of the bank organization. New Application programs are added to the system as the need arises. Thus as times goes by more the application programs and more files are added to the system. Disadvantages of File Processing System 1. Data Redundancy & Inconsistency 2. Difficulty in Accessing the data 3. Data Isolation 4. Integrity problem 5. Atomicity problems 6. Concurrent Access anomalies 7. Security problem DBMS APPROACH In order to remove all limitations of the File Based Approach, a new approach was required that must be more effective known as Database approach. The Database is a shared collection of logically related data, designed to meet the information needs of an organization. A database is a computer based record keeping system whose over all purpose is to record and maintain information. The database is a single, large repository of data, which can be used simultaneously by many departments and users. Instead of disconnected files with redundant data, all data items are integrated with a minimum amount of duplication. The database is no longer owned by one department but is a shared corporate resource. The database holds not only the organization's operational data but also a description of this data. For this reason, a database is also defined as a self-describing collection of integrated records. The description of the data is known as the Data Dictionary or Meta Data (the 'data about data'). It is the self-describing nature of a database that provides program-data independence In the DBMS approach, application program written in some programming language like Java, Visual Basic. Net, and Developer 2000 etc. uses database connectivity to access the database stored in the disk with the help of operating system's file management system. The File System interface and DBMS interface for the University Management System is shown below. Database System vs File System: Characteristics Comparison Feature / Characteristic File System Database System (DBMS) 1. Data Redundancy High, as same data may be stored in multiple files Minimized due to normalization and data integration 2. Data Integrity Hard to enforce across multiple files Maintained through constraints and rules 3. Data Consistency 4. Data Security 5. Data Access Difficult to maintain if data is updated in multiple locations Low – Security must be implemented manually Ensured by DBMS through integrity constraints High – DBMS provides access control and encryption Difficult – requires custom code for access Easy and flexible using query languages like SQL Low – changes in data format require changes in application code Difficult to manage; may lead to data 7. Multi-user Access corruption 8. Backup and Manual and time-consuming Recovery High – changes in data structure don't affect the application much Supports concurrent access with locking and transaction management Automatic and efficient backup & recovery mechanisms 9. Query Capability No built-in querying capability Powerful querying with SQL 10. Relationship between data 11. Data Storage Stored in separate flat files Easily handles relationships using foreign keys, joins, etc. Centralized and managed by DBMS Limited scalability Highly scalable for large amounts of data 6. Data Independence 12. Scalability Hard to represent and manage relationships Database Users 1.Naive or End Users: Have little or no technical knowledge of the DBMS. Use predefined interfaces or applications (like forms, dashboards). Example: customers, Bank clerks entering customer transaction data. 2.Application programmers: Application Programmers are users who write application programs that interact with the database system using high-level programming languages like Java, Python, C++, PHP, etc. Handle data inputs from users and show processed data or results. Create front-end forms or applications for users to interact with the database. Write code that enforces the rules and logic of the organization or application. 3.Sophisticated Users: Interact with the system without writing the programs. Write complex SQL queries for data retrieval, manipulation, or analysis. Ex: A data analyst writing SQL queries to analyze customer buying behavior. 4. Specialized user: write specialized database applications that do not fit into the traditional data processing framework. 5.Database Administrator A person who has central control over the system is called a DBA Coordinates all the activities of the database system has a good understanding of the enterprise’s information resources and needs. Database administrator's functions include: Schema definition: The DBA creates the original database schema by executing a set of data definition statements in the DDL. Storage structure and access method definition Schema and physical organization modification To alter the physical organization to improve the performance. Granting users authority to access the database Granting different types of authorization, the DBA can regulate which parts of the database various users can access. Backing up data Monitoring performance and responding to changes Database tuning Advantages of DBMS 1. Controlling Redundancy: In file system, each application has its own private files, which cannot be shared between multiple applications. this can often lead to considerable redundancy in the stored data, which results in wastage of storage space. By having centralized database most of this can be avoided. In a database system, however this redundancy can be controlled. For example: In case of college database, there may be the number of applications like General Office, Library, Account Office, Hostel etc. Each of these applications may maintain the following information into own private file applications: Some common data of the student which has to be mentioned in each application, like Roll no, Name, Class, Phone No, Address etc. This will cause the problem of redundancy which results in wastage of storage space and difficult to maintain. In case of centralized database, data can be shared by number of applications and the whole college can maintain its computerized data with the following database. It is clear in the above database that Rollno, Name, Class, Father_Name, Address, Phone_No, Date_of_birth which are stored repeatedly in File System in each application, need not be stored repeatedly in case of Data Base, because every other application can access this information by joining of relations on the basis of common column i.e. Rollno. Thus, we can say that centralized system of DBMS reduces the redundancy of data to great extent but cannot eliminate the redundancy because Rollno is still repeated in all the relations. 2. Integrity can be enforced: Integrity of data means that data in database is always accurate, such that incorrect information cannot be stored in database. In order to maintain the integrity of data, some integrity constraints are enforced on the database. A DBMS should provide capabilities for defining and enforcing the constraints. For Example: Let us consider the case of college database and suppose that college having only BTech, MTech, MSc, BCA, BBA and BCOM classes. But if a student enters the class MCA, then this incorrect information must not be stored in database and must be prompted that this is an invalid data entry. 3. Inconsistency can be avoided : When the same data is duplicated and changes are made at one site, which is not propagated to the other site, it gives rise to inconsistency and the two entries regarding the same data will not agree. At such times the data is said to be inconsistent. So, if the redundancy is removed chances of having inconsistent data is also removed. It can be clearly shown that inconsistency can be avoided in centralized system very well as compared to file system . 4. Data can be shared: As explained earlier, the data about Name, Class, Father name etc. of General_Office is shared by multiple applications in centralized DBMS as compared to file system . 5. Standards can be enforced : Since DBMS is a central system, so standard can be enforced easily may be at Company level, Department level, National level or International level. The standardized data is very helpful during migration or interchanging of data. The file system is an independent system so standard cannot be easily enforced on multiple independent applications. 6. Restricting unauthorized access: When multiple users share a database, it is likely that some users will not be authorized to access all information in the database. For example, account office data is often considered confidential, and hence only authorized persons are allowed to access such data. In addition, some users may be permitted only to retrieve data, whereas other are allowed both to retrieve and to update. A DBMS should provide a security and authorization subsystem, which the DBA uses to create accounts and to specify account restrictions. The DBMS should then enforce these restrictions automatically. 7. Providing Backup and Recovery: A DBMS must provide facilities for recovering from hardware or software failures. The backup and recovery subsystem of the DBMS is responsible for recovery. For example, if the computer system fails in the middle of a complex update program, the recovery subsystem is responsible for making sure that the Database is restored to the state it was in before the program started executing. 8. Cost of developing and maintaining system is lower: It is much easier to respond to unanticipated requests when data is centralized in a database than when it is stored in a conventional file system. Although the initial cost of setting up of a database can be large, but the cost of developing and maintaining application programs to be far lower than for similar service using conventional systems. The productivity of programmers can be higher in using non- procedural languages that have been developed with DBMS than using procedural languages. 9. Data Model can be developed : The centralized system is able to represent the complex data and interfile relationships, which results better data modeling properties. The data mapping properties of relational model is based on Entity and their Relationship, which is discussed in detail in chapter 4 of the book. 10. Concurrency Control : DBMS systems provide mechanisms to provide concurrent access of data to multiple users. Disadvantages of DBMS 1. Complexity : The provision of the functionality that is expected of a good DBMS makes the DBMS an extremely complex piece of software. Database designers, developers, database administrators and end-users must understand this functionality to take full advantage of it. Failure to understand the system can lead to bad design decisions, which can have serious consequences for an organization. 2. Size : The complexity and breadth of functionality makes the DBMS an extremely large piece of software, occupying many megabytes of disk space and requiring substantial amounts of memory to run efficiently. 3. Performance: Typically, a File Based system is written for a specific application, such as invoicing. As a result, performance is generally very good. However, the DBMS is written to be more general, ie used for many applications rather than just one. The effect is that some applications may not run as fast as they used to. 4. Higher impact of a failure: The centralization of resources increases the vulnerability (possibility of being attacked) of the system. Since all users and applications rely on the availability of the DBMS, the failure of any component can bring operations to a halt. 5. Cost of DBMS: The cost of DBMS varies significantly, depending on the environment and functionality provided. There is also the recurrent annual maintenance cost. 6. Additional Hardware costs: The disk storage requirements for the DBMS and the database may necessitate the purchase of additional storage space. Furthermore, to achieve the required performance it may be necessary to purchase a larger machine, perhaps even a machine dedicated to running the DBMS. The procurement of additional hardware results in further expenditure. 7. Cost of Conversion: In some situations, the cost of the DBMS and extra hardware may be insignificant compared with the cost of converting existing applications to run on the new DBMS and hardware. This cost also includes the cost of training staff to use these new systems and possibly the employment of specialist staff to help with conversion and running of the system. This cost is one of the main reasons why some organizations feel tied to their current systems and cannot switch to modern database technology. Objectives of DBMS Mass Storage: DBMS can store a lot of data and can fetch data when ever it is needed. Removes Duplicity: Checks are provided while inserting new records. Multiple Users Access: Allows Concurrent Access also. Data Protection: No one can alter or modify without privilege of using the data. Data Backup and Recovery: Ability to back up and recover all the data in DB. Everyone can work on DBMS: No need to be a master. Non technical back ground person can work on it. Integrity: Multiple validity checks that makes data completely accurate and consistence. Platform Independent: Can run on any platform. Database Management System (DBMS) DBMS contains information about a particular enterprise Collection of interrelated data Set of programs to access the data An environment that is both convenient and efficient to use Database Applications: Banking: all transactions Airlines: reservations, schedules Universities: registration, grades Sales: customers, products, purchases Online retailers: order tracking, customized recommendations Manufacturing: production, inventory, orders, supply chain Human resources: employee records, salaries, tax deductions Databases touch all aspects of our lives DATA MODELS Data Model: Collection of conceptual tools for describing 1. Data 2. Data relationships 3. Data schema 4. Consistency constraints The various data models that have been proposed fall into 3 types DATA MODELS LOGICAL MODEL PHYSICAL MODEL EX: 1. UNIFYING MODEL 2. FRAME MEMORY MODEL OBJECT BASED EX: 1.ER MODEL 2.OBJECTORIENTED MODEL RECORD BASED EX: 1. RELATIONAL MODEL 2. NETWORK MODEL 3. HIERARCHIAL MODEL The Entity-Relationship Model Models an enterprise as a collection of entities and relationships Entity: a “thing” or “object” in the enterprise that is distinguishable from other objects Described by a set of attributes Relationship: an association among several entities Represented diagrammatically by an entity-relationship diagram: The Entity-Relationship Model Advantages: Visual modeling yields exceptional conceptual simplicity. Visual representation makes it an effective communication tool. It is integrated with dominant relational model. Disadvantage: Limited constraint representation. Limited relationship representation. No manipulation language Loss of information when attributes are removed. Object Oriented Model Here data and relationships are contained in a single structure known as Object. Object is equivalent to ER Model entity. Object Oriented Model Advantages: Semantic content is added Inheritance promote data integrity. Disadvantage: It is complex navigational system. There is steep learning curve. Hierarchical Model • First database systems introduced in the 1960’s were based on the “hierarchical model” • This model assumes all data relationships can be structured as hierarchies. • Uses a “parent”” and “child” relationship where a child can only have one parent. Employer Compensation Job Benefits Assignments Ratings Salary Pension Insurance Health • Hierarchical Model still used today on some IBM mainframes such as IBM’s IMS system. • Need to redesign entire database to change how data is interrelated. • Can lead to confusion in relationships of data. • Only allows one parent record type. Hierarchical Model Advantages: It promotes data showing. Parent/Child relationship promotes conceptual simplicity, Data integrity. Data base security is provided. Efficient with 1:many relationship. Disadvantage: Lack of standards. No data definition language. No manipulation language Network Model • Network Model came about from the Conference on Data Systems Language (CODASYL). • Design is based on “data sets” • Similar to the hierarchical model with sequential access properties. • Uses logically related data items to define record types. • As data sets are added so is the complexity and confusion. • Procedural model of one record processing at a time. • Difficult to change data once it is stored • Need detailed understanding of the data and how it is stored. Network Model Advantages: Conceptual simplicity. Data access is more flexible than hierarchical model. Data owner/ member relationship promotes data integrity. Many to many relationships is possible. Disadvantage: Structural dependent. Navigation system is complex for applications. System complexity. Relational Model Attributes Example of tabular data in the relational model A Sample Relational Database Relational Model Advantages: Simplicity: A relational data model is simpler than the hierarchical and network model. Structural Independence: The relational database is only concerned with data and not with a structure. This can improve the performance of the model. Easy to use: The relational model is easy as tables consisting of rows and columns is quite natural and simple to understand Query capability: It makes possible for a high-level query language like SQL to avoid complex database navigation. Data independence: The structure of a database can be changed without having to change any application. Scalable: Regarding a number of records, or rows, and the number of fields, a database should be enlarged to enhance its usability. Disadvantage: Few relational databases have limits on field lengths which can't be exceeded. Relational databases can sometimes become complex as the amount of data grows, and the relations between pieces of data become more complicated. Complex relational database systems may lead to isolated databases where the information cannot be shared from one system to another. View of Data An architecture for a database system Levels of Abstraction Physical level: It describes how a record (e.g., customer) is stored. It gives answer to the questions of “HOW” Logical level: It describes WHAT data stored in database, and the relationships among the data. type customer = record customer_id : string; customer_name : string; customer_street : string; customer_city : string; end; View level: Application programs hide details of data types. Views can also hide information (such as an employee’s salary) for security purposes. Only some portion of the total DB is viewed by some particular user Instance/Schemas and Data Independence Instance : Information in DB at a particular moment Schema: Overall database design Database system has several schemas 1.Physical schema 2.Logical schema 3.Many sub schemas Data Independence: Ability to modify schema definition in one level without effecting schema definition in next higher level 1. Physical Data Independence 2. Logical Data Independence Physical Data Independence: Definition: The ability to change the physical storage structure or access methods without affecting the logical schema. Example: Changing file organization (like from heap file to B+ tree) or using indexing for performance improvements, without changing how the data is logically represented. Logical Data Independence: Definition: The ability to change the logical schema (e.g., tables, views, relationships) without altering the external schema or application programs. Example: Adding a new column to a table or splitting a table into two without changing user views or applications that access the data. Three tier schema architecture for data independence The Three-Tier Schema Architecture is a framework used in Database Management Systems (DBMS) to achieve data independence, meaning changes in one layer do not affect the others. It consists of three levels 1. Internal Level (Physical Level) Definition: Describes how data is physically stored in the database (e.g., indexes, storage blocks). Concerned with: Efficiency, performance, data compression, file organization. Example: Storing a student record as bytes in disk blocks. 2. Conceptual Level (Logical Level) Definition: Describes the logical structure of the entire database for a community of users. Concerned with: Tables, relationships, constraints, data types. Example: Student(Name, Roll_No, Course, Marks) 3. External Level (View Level) Definition: Describes different user views of the database (customized for different users). Concerned with: Security, simplicity, user interfaces. Example: A student sees only their marks; a teacher sees marks of all students. View of Data An architecture for a database system Why Three-Tier Architecture? (Data Independence) Logical Data Independence: Changes in conceptual schema (e.g., adding a new column) don’t affect external views. Helps in updating database structure without changing user applications. Physical Data Independence: Changes in internal schema (e.g., changing file storage) don’t affect conceptual schema. Helps in optimizing storage without impacting database structure Database System Structure 1. Query Processor It interprets the requests (queries) received from end user via an application program into instructions. It also executes the user request which is received from the DML compiler. Query Processor contains the following components DML Compiler: It processes the DML statements into low level instruction (machine language), so that they can be executed. DDL Interpreter: It processes the DDL statements into a set of table containing meta data (data about data). Embedded DML Pre-compiler: It processes DML statements embedded in an application program into procedural calls. Query Optimizer: The Query Optimizer executes instructions generated by the DML Compiler and improves query execution efficiency by choosing the best query plan, considering factors such as indexing, join order, and available system resources. For instance, if a query involves joining two large tables, the optimizer will select the best join order to minimize query execution time. 2. Storage Manager Storage Manager is an interface between the data stored in the database and the queries received. It is also known as Database Control System. It maintains the consistency and integrity of the database by applying the constraints and executing the DCL statements. It is responsible for updating, storing, deleting, and retrieving data in the database. It contains the following components: Authorization Manager: It ensures role-based access control, i.e,. checks whether the particular person is privileged to perform the requested operation or not. Integrity Manager: It checks the integrity constraints when the database is modified. Transaction Manager: It controls concurrent access by performing the operations in a scheduled way that it receives the transaction. Thus, it ensures that the database remains in the consistent state before and after the execution of a transaction. File Manager: It manages the file space and the data structure used to represent information in the database. Buffer Manager: It is responsible for cache memory and the transfer of data between the secondary storage and main memory. 3. Disk Storage It contains the following essential components: Data Files: It stores the actual data in the database. Data Dictionary: It contains the information about the structure of database objects such as tables, constraints, and relationships. It is the repository of information that governs the metadata. Indices: Provides faster data retrieval by allowing the DBMS to find records quickly, improving query performance. Database Environment A database environment is a collective system of components that comprise and regulates the group of data, management, and use of data, which consist of Software Hardware People, Techniques of handling database, Data. Hardware in a database environment means the computers and computer peripherals that are being used to manage a database. Software means the whole thing right from the operating system (OS) to the application programs that include database management software like M.S. Access or SQL Server. The people in a database environment include those people who administrate and use the system. The techniques are the rules, concepts, and instructions given to both the people and the software along with the data with the group of facts and information positioned within the database environment Centralized and Client/Server Architectures for DBMS The architecture of a Database Management System (DBMS) can significantly influence its performance, scalability, and overall functionality. • Two primary architectures used for DBMSs are Centralized Architecture and Client/Server Architecture. Centralized Architecture In a centralized DBMS architecture, the entire database system—including the database itself and the DBMS software—resides on a single central server. All users access the system through dumb terminals or remote user interfaces connected to this central machine. The central server is responsible for handling all data storage, query processing, and transaction management. Advantages: Simplicity: Easier to manage and maintain since everything is centralized. Consistent Performance: Performance is predictable as all data and processes are contained within a single system. Simplified Backup and Recovery: Centralized control over data makes it easier to implement and manage backup and recovery processes. Security: Easier to secure a single system compared to multiple distributed systems. Disadvantages: Scalability Issues: Limited by the capacity of the single server; scaling up can be costly and complex. Single Point of Failure: If the central server fails, the entire database system becomes unavailable. Performance Bottlenecks: High load can cause performance degradation as all operations are performed by a single server. Limited Flexibility: Less flexible in terms of distributing workloads and optimizing resource usage. Client/Server Architecture In a client/server DBMS architecture, the database system is divided into two logical components: The server, which stores and manages the database. The client, which provides the user interface and sends requests to the server. The server handles data processing and storage, while the client handles input/output and presentation. Communication occurs over a network using standard protocols. Advantages: Scalability: Easier to scale out by adding more clients and servers as needed. Distributed Load: Workloads can be distributed across multiple servers, improving performance and efficiency. Improved Availability: Redundancy and failover mechanisms can be implemented to ensure higher availability. Flexibility: Different clients can run on different platforms and still interact with the central database server. Disadvantages: Complexity: More complex to manage and maintain due to the distributed nature of the system. Network Dependency: Performance is reliant on network speed and reliability. Security Challenges: More points of access increase potential security risks and make management more challenging. Data Consistency: Ensuring data consistency across multiple clients can be more complex, especially in distributed environments. “WITHOUT TEACHERS, LIFE WOULD HAVE NO CLASS.” Respect your TEACHERS.
0
You can add this document to your study collection(s)
Sign in Available only to authorized usersYou can add this document to your saved list
Sign in Available only to authorized users(For complaints, use another form )