CIE AS & A Level Computer Science, section 8.1 (Database concepts)
The file-based approach
In a file-based system, each application keeps its own files of data. For example, a school might keep a student file for the office, another for the library and another for the canteen.
Limitations
| Problem | Explanation |
|---|---|
| Data redundancy | the same data (such as a student's address) is stored in several files, wasting space |
| Data inconsistency | when one copy is changed and others are not, the files disagree |
| Data dependency | programs are tied to the file format, so changing a file means rewriting every program that uses it |
| Poor data sharing | data cannot easily be combined across files, and queries need new programs |
| Weak security | difficult to control which user sees which data |
| Poor concurrent access | two users changing the same file at once can corrupt it |
The relational approach
A relational database stores data in linked tables, managed by a database management system (DBMS). Each fact is stored once.
| Feature of a relational database | Limitation it solves |
|---|---|
| Each item of data is stored once and linked by keys | redundancy and inconsistency |
| The DBMS separates the data from the programs that use it | data dependency |
| Queries (SQL) combine data from several tables | poor data sharing |
| Access rights for users and groups | weak security |
| The DBMS controls simultaneous access and backup | concurrent access problems |
Worked example
A shop records a customer's address in its orders file and its mailing list file. When the customer moves, only one file is updated, so the files are inconsistent. In a relational database the address is in a single Customer table, and the other tables link to it with the customer ID.
Common mistake: describing data redundancy as "backing up data". Redundancy means the unnecessary duplication of data, which causes waste and inconsistency. Backup copies are made on purpose.
Exam tip: when asked about limitations of a file-based system, give at least three (redundancy, inconsistency, dependency) and, for each, how a relational database solves it.
Check yourself
What is data redundancy?
The same data is stored in more than one place unnecessarily.
Why can data inconsistency happen in a file-based system?
One copy of the data is updated but other copies are not, so they disagree.
How does a relational database reduce redundancy?
Each fact is stored once in a table and other tables link to it using keys.