File System Vs Database System Scenerio Discussion
File System Vs Database System Scenerio Discussion
You are managing a small hospital that keeps track of patient records, doctor information, and
appointment schedules using a traditional file system. Each type of information is stored in
separate text files: one for patients, one for doctors, and one for appointments.
Questions:
1. Data Organization: Compare how data is organized in your traditional file system versus a
relational database system. What are the advantages and disadvantages of each?
2. Data Redundancy: Identify potential data redundancy issues in your current file system
setup. How can a database management system (DBMS) help reduce this redundancy?
3. Querying Data: Explain how you would generate a report of all appointments for a specific
doctor along with patient names in both systems. What are the differences in execution?
4. Scalability: Discuss the challenges you might face as the hospital grows using a traditional
file system. How does a DBMS provide a more scalable solution?
Solutions:
1. Data Organization
Advantages:
Disadvantages:
Data is organized into structured tables (e.g., Patients, Doctors, Appointments) with defined
relationships.
Advantages:
2. Data Redundancy
Data redundancy can occur when patient details are recorded multiple times for different
appointments, leading to inconsistencies.
A DBMS reduces redundancy by normalizing data. Patient details are stored in one table,
and each appointment references the patient through a foreign key, ensuring data is only
recorded once.
3. Querying Data
sql
Copy code
SELECT Patients.name, Appointments.date
FROM Appointments
JOIN Patients ON Appointments.patient_id = Patients.id
WHERE Appointments.doctor_id = 'specific_doctor_id';
This retrieves the needed information efficiently and accurately with a single command.
4. Scalability
Challenges with Traditional File System:
As the hospital expands and the number of patients and appointments grows, managing
multiple text files becomes increasingly cumbersome.
Performance issues may arise as file sizes increase, resulting in slow data retrieval and
updates.
Maintaining data integrity becomes difficult with many files, increasing the likelihood of
errors.
A DBMS can handle large volumes of data efficiently with indexing and optimized querying.
Supports concurrent access, allowing multiple users (e.g., nurses, doctors) to access the
system simultaneously without conflicts.
Adding new data (e.g., new patient fields or appointment types) is easier, and schema
changes can be managed more flexibly.