Why DBMS replaced file-based systems - Performance Analysis
We want to understand how the time to access and manage data changes when using file-based systems versus DBMS.
How does the system handle more data and more users efficiently?
Analyze the time complexity of searching for a record in a file-based system versus a DBMS.
-- File-based system: linear search
OPEN file;
FOR each record IN file LOOP
IF record matches THEN
RETURN record;
END IF;
END LOOP;
CLOSE file;
-- DBMS: indexed search
SELECT * FROM table WHERE key = value;
The file-based system searches records one by one, while DBMS uses indexes to find data faster.
Look at what repeats when searching data.
- Primary operation: Checking each record in the file one by one (file-based).
- How many times: As many as the number of records until the match is found or file ends.
- DBMS operation: Using an index to jump directly to the record.
- How many times: Very few steps, depends on index structure, not total records.
As the number of records grows, the file-based search takes longer because it checks more records.
| Input Size (n) | Approx. Operations (File-based) |
|---|---|
| 10 | Up to 10 checks |
| 100 | Up to 100 checks |
| 1000 | Up to 1000 checks |
Pattern observation: The time grows directly with the number of records.
For DBMS, the number of steps grows much slower, often like the height of a tree, not the total records.
Time Complexity: O(n) for file-based search
This means the time to find data grows directly with the number of records in the file.
[X] Wrong: "Searching a file is always fast because computers are quick."
[OK] Correct: Even fast computers take longer if they must check every record one by one as data grows.
Understanding how data access time grows helps you explain why DBMS are better for large data and multiple users.
This skill shows you can think about system efficiency, a key part of many tech discussions.
What if the file-based system used an index like a DBMS? How would the time complexity change?
Practice
Solution
Step 1: Understand problems with file-based systems
File-based systems often caused data duplication and inconsistency because each application managed its own files separately.Step 2: Identify DBMS benefits
DBMS was introduced to solve these problems by centralizing data management and reducing duplication and inconsistency.Final Answer:
To reduce data duplication and inconsistency -> Option DQuick Check:
DBMS solves duplication and inconsistency issues [OK]
- Thinking DBMS increases file size
- Believing DBMS limits users to one
- Confusing manual entry increase with DBMS purpose
Solution
Step 1: Review user access in file-based systems
File-based systems usually restrict access to one user at a time, causing delays and conflicts.Step 2: Understand DBMS multi-user support
DBMS supports multiple users accessing data safely and efficiently at the same time.Final Answer:
DBMS allows multiple users to access data simultaneously -> Option CQuick Check:
Multi-user access = DBMS feature [OK]
- Assuming DBMS needs manual file handling
- Thinking DBMS stores only text files
- Believing DBMS lacks security
Solution
Step 1: Identify cause of inconsistency in file systems
Data inconsistency happens when different files have conflicting or outdated data copies.Step 2: Understand DBMS approach
DBMS centralizes data in one place and applies rules to keep data consistent and accurate.Final Answer:
DBMS centralizes data storage and enforces rules -> Option AQuick Check:
Centralized storage = consistent data [OK]
- Thinking DBMS uses multiple separate files
- Believing direct file edits improve consistency
- Assuming DBMS removes backups
Solution
Step 1: Identify problems in current system
Data duplication and poor security arise from scattered files and uncontrolled access.Step 2: Choose solution that addresses these issues
Using a DBMS centralizes data and controls who can access or change it, solving duplication and security problems.Final Answer:
Switch to a DBMS with controlled access and centralized data -> Option BQuick Check:
Centralized control fixes duplication and security [OK]
- Adding more manual files increases duplication
- Allowing all edits reduces security
- Storing data on personal computers lacks control
Solution
Step 1: Understand the need for sharing and security
Sharing data safely requires multiple users to access data at once without conflicts or errors.Step 2: Identify DBMS feature that manages this
DBMS supports concurrent access with transaction control to keep data consistent and secure during multiple operations.Final Answer:
Concurrent access with transaction control -> Option AQuick Check:
Transaction control ensures safe multi-user access [OK]
- Confusing redundancy with better sharing
- Thinking manual copying is safe
- Believing isolated files improve sharing
Ready to prove it?
Pass the test and this pattern moves unknown
