s5.07.01 - flat files vs relational databases
Comparing flat-file limitations like data redundancy with the structured integrity of relational database systems.

Ever wondered how enterprise platforms like Amazon, Spotify, or Steam handle hundreds of millions of user accounts, transactions, and media catalogues simultaneously without corrupting a single byte? They certainly do not run on a gigantic shared spreadsheet. In this lesson, you will step into the shoes of a Data Architect and Data Custodian to investigate why flat files collapse under scale, and how relational database architectures enforce absolute data integrity across modern computing systems.
Learning Outcomes
Factual (Knowing that)
Conceptual (Knowing why)
Procedural (Knowing how)
Recall the operational definitions of a flat-file database, a relational database, and a Database Management System (DBMS).
Describe the principles of data redundancy, data consistency, and programmatic data independence.
Conceptual (Knowing why)
Analyse how unmanaged data redundancy inevitably precipitates insertion, update, and deletion anomalies.
Evaluate the systemic advantages of a multi-table relational architecture over single-table flat files in preserving data integrity.
Procedural (Knowing how)
Apply decomposition techniques to isolate distinct entities and attributes from an unnormalised flat-file table.
Create a decomposed multi-table relational outline that eliminates modification anomalies for an enterprise scenario.
The Deep Dive
From Flat Files to Relational Architecture
The Flat-File Paradigm
At its most fundamental level, a database is an organised collection of data structured for programmatic retrieval and updating. The simplest storage architecture is a flat-file database. In a flat-file model, all records and fields are held within a single, continuous two-dimensional structure - such as a comma-separated values (CSV) text file or an isolated spreadsheet table. Each line or row represents a distinct record, and individual columns represent specific data fields.
While a flat file is sufficient for simple, personal datasets (such as a private contact list), it fails catastrophically when applied to multi-user or enterprise systems. As transactional volume and entity complexity increase, storing all attributes across a single file introduces severe architectural flaws, most notably data redundancy.
Data Redundancy and the Threat to Data Integrity
Data redundancy is the unnecessary, repeated storage of the same data item across multiple records in a system. Consider a college registration database maintained as a single flat file:

So much redundancy...
In this redundant structure, every time a student enrols on a course, the corresponding
Tutor Name and Room Name are duplicated. If a lecturer instructs forty students, their name and office location are stored forty separate times.Redundancy wastes secondary storage space, but its most dangerous consequence is the degradation of data integrity. Data integrity guarantees that data stored within an information system remains accurate, complete, and consistent throughout its entire lifecycle. In a redundant flat file, data updates inevitably produce three critical failure modes known as data anomalies.
1
Update Anomalies
An update anomaly occurs when an item of duplicated data is modified in some records but left unaltered in others. If a lecturer moves to a different room, every single student enrolment record featuring that tutor must be identified and altered. If an administrative script or user updates thirty-nine rows but misses the fortieth, the database enters an inconsistent state. Conflicting records report different office locations for the same individual, destroying trust in the system. There are now two truths.
2
Insertion Anomalies
An insertion anomaly occurs when a user cannot record legitimate data about a particular entity because it is dependent on attributes from another entity that do not yet exist. If the college recruits a new tutor who has not yet been assigned any enrolled students, the system cannot store their details; the flat-file record requires a
Student ID and Student Name to form a valid row entry. The new tutor's metadata cannot exist independently.3
Deletion Anomalies
A deletion anomaly occurs when the removal of one piece of data causes the unintended, catastrophic loss of entirely separate information. If the sole student enrolled on an elective subject withdraws from college, purging that student's record deletes the only existing instance of the
Course ID, Course Name, and assigned tutor details from the database.The Relational Solution and the DBMS
To eradicate data redundancy and modification anomalies, data architects utilise the relational model. Rather than aggregating all attributes into a single table, the relational approach decomposes data into distinct, specialised tables, where each table represents a single entity (such as
Student, Course, or Tutor).This approach is championed by Dr. E.F. Codd's foundational work in the 1970s.

No redundancy?
Each fact is recorded exactly once in exactly one place. If a tutor changes name or title, only one row in the
Tutor table requires alteration. The updated value is immediately and consistently reflected across all related queries throughout the system.The Database Management System (DBMS)
Relational databases are orchestrated by a Database Management System (DBMS) - enterprise software such as PostgreSQL, MySQL, Oracle Database, or Microsoft SQL Server. The DBMS provides critical architectural capabilities:
Data Consistency and Referential Integrity: Enforcing constraints so that records cannot reference non-existent parent data. This ensures the relationships between tables remain valid.
Programmatic Data Independence: Separating the conceptual and physical storage schema from user applications. The underlying table indices or file structures can be reconfigured without requiring modifications to the client application code, significantly simplifying maintenance and evolution.
Concurrency Control and Multi-User Access: Managing simultaneous reads and writes using record-level or table-level locking to prevent race conditions and dirty reads. This is vital for systems like online banking, where multiple users interact with the same data simultaneously.
Centralised Security and Access Control: Applying granular permissions, role-based access controls, and transaction auditing across all tables, ensuring data confidentiality and controlled access.
Force a connection. Identify two concepts from these notes and explicitly link them to a topic we covered in a previous module or term (such as OOP encapsulation, file handling modes, or network protocol layers). Write a concise technical paragraph explaining how understanding one strengthens your understanding of the other.
Comprehension Questions
Answer these questions on your lesson sheet.1
Define the term 'data redundancy' and state why it represents a severe operational threat beyond wasting secondary storage.
2
Explain what an update anomaly is and describe how it compromises data consistency.
3
Describe a practical scenario that illustrates an insertion anomaly within a flat-file database.
4
Explain what occurs during a deletion anomaly when an unnormalised record is purged from a system.
5
Define the concept of 'data independence' as provided by a modern Database Management System (DBMS).

Task Deconstructing the Dealership Flat File
An expanding regional motor dealership tracks all vehicle sales using a single unnormalised spreadsheet. Sales representatives, vehicle stock, customer profiles, and financial transactions are currently flattened into one shared table. The dealership is experiencing severe inventory errors and inconsistent client records. You have been brought in as a Data Architect to audit the existing flat-file system and engineer a relational replacement.
0
Get Organised!
Prepare a structured workspace on your lesson sheet to document anomalous records, entity decompositions, and relational table drafts.
1
Audit the Dealership Flat File
Examine the sample flat-file record excerpt provided below:

Car sales
On your lesson sheet, identify three specific data fields (columns) that exhibit severe data redundancy across these transactions.
2
Analyse Real-World Anomaly Scenarios
Using the dealership data excerpt, construct a concrete technical example for each of the three data anomalies:
Update Anomaly: Detail what might occur if Sales Representative Lisa Wong updates her legal surname following a marriage, but the dealership records coordinator updates only SaleID 501.
Insertion Anomaly: Explain why the dealership cannot add details for a newly purchased vehicle (VIN: SAJ55190) that has arrived at the Manchester branch but has not yet been sold to a customer.
Deletion Anomaly: Explain what data is lost if customer Mark Evans cancels his order and record SaleID 502 is completely deleted from the flat file.
3
Decompose into Discrete Relational Entities
Deconstruct the single flat-file structure into distinct, single-purpose entities. On your lesson sheet:
Declare at least four independent entities (for example,
tblCustomer, tblVehicle, tblBranch, tblSalesRepresentative, tblSale).Under each entity heading, list the appropriate attributes that belong exclusively to that entity.
Hungry for more?
Search the web: database anomalies and data redundancy relational decomposition
Ask an AI: Click on the carefully written prompt below to learn more...
Role: Lead Database Architect. Task: Explain the precise operational mechanisms of insertion, update, and deletion anomalies in flat file data storage, contrasting them with a normalised relational model. Length: Under 180 words. Audience: A-Level Computer Science student. Tone: Rigorous, academic, and objective. Constraints: Use a concrete commercial example and bullet points for the three anomalies. NO intro, NO outro, NO deviation from the topic, NO follow-up questions.
The Single Source of Truth: Write a concise, three-line architectural justification explaining why enterprise platforms must maintain a single source of truth (SSOT) for critical customer identity records.
Outcome: A comprehensive diagnostic analysis of the car dealership flat file identifying all three modification anomalies, accompanied by a decomposed multi-table relational schema blueprint.

Sticky Note Challenge
Draw a simple sketch showing two separate boxes labelled 'tblStudent' and 'tblTutor'. Draw a directional arrow connecting them and write down the single shared attribute that connects them without duplicating the tutor's telephone number. Stick it onto your lesson sheet and hand your completed lesson sheet into your teacher.Last modified: October 20th, 2026
