The key problems in the traditional file environment are listed below:
- Data Redundancy
- Data Inconsistency
- Data Isolation
- Difficulties in accessing data
- Integrity problem
- Atomicity problem
- Concurrent access anomalies
- Security problems
Data redundancy: Data redundancy means duplication of same data or data files in different places. Flat file systems are suffered from the problem of high data redundancy. For example, record (such as student id, name, level, program, section etc) of a student may appear in library data files as well as examination data files. This redundancy leads to higher storage and access cost. On the other hand database management systems can greatly reduce the problem of data redundancy. Note that DBMS cannot remove data redundancy problem completely.
Data inconsistency: Data inconsistency is side effect of data redundancy. Data is said to be inconsistent if various copies of the same data may no longer agree. Data inconstancy occurs if changed data is reflected in data files in one place but not elsewhere in the system. For example, if library data file contains cell number of a student as 9841567843 but examination data files stores 9851167895 as cell number of the student then we can say that data is inconsistent. Flat file systems may suffer from the problem of data inconsistency. But database systems can remove the problem of data inconstancy by automatically propagating data updates done in one file in the database in other data files.
Data isolation: Because data are scattered in various files, and files may be in different formats, writing new application programs to retrieve the appropriate data is difficult in flat file systems. For example, one data file may contain data separated of comma and another data file may contain data separated by white space.
(a)
Figure: Data files (a) Data separated by comma (b) Data separated by white space Database management systems provide shared access to centrally stored data therefore it is easy for application programs to retrieve required data from centralized database. Application programs do not need to bother about format of stored data.
Difficulty in accessing data: File processing systems do not allow required data to be retrieved in efficient and convenient way. For example, assume we already have program to generate the list of books on the basis of subject. Now, if we need to generate the list of books on the basis of author name, either we need to extract the data from book data files manually or we should request the programmer to write a program to retrieve required data from the book data file. Both of the alternatives are not satisfactory.
Integrity problems: Integrity means correctness of data before and after execution of a transaction. Integrity constraints are condition applied to the data. For example, if maximum salary in an organization is 150,000 then we have the integrity constraint ―salary ≤ 150,000‖. Integrity constraints are important to maintain correctness of data. It plays vital to prevent users from doing mistakes. For example, if user mistakenly types 200,000 in place of 20,000 while transferring salary of an employee in his/her account, specified integrity constrain is violated and hence the system tell the user about the mistake.
Unfortunately, flat file systems do not allow us to specify integrity constraint and hence it is difficult to maintain correctness of data. On the other hand, database management systems allow us to specify integrity constraints on data therefore relatively it is easy to maintain correctness of data
.
Atomicity problems: Execution of transactions must be atomic. This means transactions must execute at its entirety or not at all. If execution of transaction is not atomic, it leaves database in incorrect sate. Consider the example of transaction that transfers 5000 rupees from account A to account B.
If the execution of transaction is failed at the point specified in above figure, it causes 5000 rupees to be deducted from account A without depositing it in account B. File processing system do not guarantee atomic execution of transactions and hence this type of problems may occur in databases. But database systems guarantees atomicity of execution of transaction and hence above mentioned problem can be eliminated.
Point of Failure
Concurrent-access anomalies: Concurrent updates to same data by different transactions at the same time may result in inconsistent data. Consider bank account ‗A‘, containing 50,000 Rs. If two customers withdraw funds say 15,000
and 20,000 respectively from account A at about the same time, the result of the concurrent executions may leave the account in an incorrect (or inconsistent) state, if the programs executing on behalf of each withdrawal read the old balance as below. Flat file systems do not supports execution of concurrent transactions and hence may suffer from the problem mentioned below. But, database systems support concurrent execution of transactions on the same data without resulting into inconstant data.
|
Reads old balance Final Balance=30000 Wrong!!!!!!!!
It must be 15000
Security problems: In database system we may create different user accounts and provide different authorization to different users. Thus we are able to hide certain information from some users. For example, in a banking system, payroll personnel need to see only that part of the database that has information about the various bank employees. They do not need access to information about customer accounts. This type of restriction is essential for security purpose. But, file processing system do not allow us to create user accounts thus all users have equal access to the data. Due to this it is difficult to maintain security of flat file systems. Besides this file processing systems do not have any provisions for periodic backup of data and recovery from data loss which are provided by database management systems.