File System vs DBMS: Why DBMS Replaced File Systems

2.6M views
July 13, 2018
by
Gate Smashers
YouTube video player
File System vs DBMS: Why DBMS Replaced File Systems

TL;DR

DBMS beats a file system on five points: searching, attribute independence, concurrency, security, and redundancy. A file-system search for one train's details can pull an entire 25 GB file, while a SQL query returns just the 1 KB needed. DBMS also adds concurrency protocols, role-based access control, and key constraints that file systems lack.

Transcript

Hello friends, welcome to Gate Smashers the topic is file system Vs DBMS, So in the first video we discussed the basic introduction & the definition of the DBMS, but now the first thing that comes to our mind is that which system was used before DBMS, or what was the problem in that system did, which was removed by DBMS or we can also say in this w... Read More

Key Insights

  • File systems were the standard before DBMS and are still built into operating systems today, with examples such as CIFS and NFS storing data hierarchically in drives, folders, and subfolders on a user's own machine.
  • The shift to DBMS was driven by client server architecture, where data sits at a centralized server location and users all over the world access it simultaneously rather than a single user managing files on one personal system.
  • Searching is far more efficient in DBMS because a user writes a simple SQL query and receives only the 1 KB needed, whereas a file system would transfer an entire 25 GB train data file just to find one record.
  • File system access requires metadata attributes first, meaning the file name, file location, and file permission, such as a path like C:/folder1, before any data can be reached.
  • DBMS provides data independence, so the user never knows where data is physically stored and needs no attributes; a request from a web or mobile application goes to the server and the server responds directly.
  • Concurrency means multiple people accessing the same data at the same time, and IRCTC reportedly handles 2 to 3 lakh transactions per day, which can mean 1,000 to 2,000 transactions happening simultaneously.
  • File systems have no concurrency protocol, so thousands of simultaneous accesses can cause data inconsistency; DBMS defines protocols where read-read is safe but read-write, write-read, and write-write are problematic.
  • Role based access control lets a DBMS create separate users and roles, such as student, faculty, and dean, so each role sees only permitted data while the rest appears not to exist even though it is available to other roles.

Install to Summarize YouTube Videos and Get Transcripts

Explore YouTube Video Summarizer or Get YouTube Transcript Extractor

Questions & Answers

Q: What is the difference between a file system and a DBMS?

A file system stores data as files in drives, folders, and subfolders in hierarchical form and is inbuilt in the operating system, with CIFS and NFS given as examples. A DBMS keeps data on a centralized server that many users access through queries. The video lists five differences: searching efficiency, the need for attributes, concurrency handling, security, and data redundancy. File systems suit a single user managing their own data, while DBMS suits client server architecture where users worldwide access shared data.

Q: Why is searching faster in DBMS than in a file system?

With a file system, retrieving one train's details means the complete file arrives. In the example given, the user wants only 1 kB of data about a particular train, but roughly 25 GB of train data travels to their system. That takes time and uses memory unnecessarily, and the user still has to search inside it. In DBMS, the full 25 GB stays on the Indian Railways server and the user writes a simple SQL query, so only the 1 KB requested is returned. Searching is fast and memory utilization is efficient.

Q: What are the disadvantages of a file system?

The video lists five. Searching returns entire files instead of just the records needed, wasting bandwidth and memory. Access requires metadata attributes such as file name, file location, and file permission. There is no concurrency protocol, so simultaneous access by thousands of users can cause data inconsistency. Security is handled by the operating system with a single login password and no hierarchical or role based levels. Finally, the same content can be stored repeatedly under different file names, creating data redundancy.

Q: What is metadata in the context of file system access?

Metadata is data about data, meaning the data about a particular file. To access data through a file system, the user first needs attributes such as the file name, the file location, and the file permission. A location looks like C:/folder1 or C:/folder2, and the data can only be accessed once that path is known. DBMS removes this requirement because it is totally independent: the user does not know where the data is actually stored and simply writes a query from any platform, such as a web or mobile application.

Q: What is concurrency in DBMS and why does it matter?

Concurrency means concurrent access, where multiple people access the same data at the same time. It is described as the most important thing in today's time. The IRCTC example cites a survey reporting 2 to 3 lakh transactions every day on the server, which can mean 1,000 to 2,000 transactions happening at one moment. DBMS provides proper concurrency protocols: read-read causes no problem, while read-write, write-read, and write-write are problematic. File systems have no such protocol, so thousands of simultaneous accesses can produce data inconsistency.

Q: How does DBMS provide better security than a file system?

DBMS provides role based access control. Different users and roles can be created, for example a student, a faculty member, and a dean in a university, so each role sees only the data intended for it while the rest is invisible to them even though it still exists under another role. The Indian Army SSB form example shows authenticated users having a separate role from applicants. A file system is handled by the operating system, which only asks for a password at startup; once the system is on, any drive can be opened, and there is no level by level hierarchical security.

Q: How does DBMS prevent data redundancy?

Redundancy means duplicacy, such as storing the same student Ram with roll number 1 four times in an Excel file when there is only one such student. A file system does not prevent this: the operating system stops two files with the same name in the same place, but the same content can be saved under different names. DBMS applies constraints, including primary key and foreign key constraints, which help with data integrity and ensure only unique data is stored, so the same record is not duplicated.

Q: Why is DBMS used in client server architecture and web applications?

In client server architecture, data is not held only by one user; it sits at a centralized server location and users all over the world connect to that server to access it. Under those conditions the file system cannot handle the search volume, concurrent access, or security requirements. That is why today's client server architectures and web applications run DBMS on the backend. Applications like Flipkart, Amazon, Google, and IRCTC put the user at the frontend while the DBMS on the backend handles the data, receives requests, and responds to them.

Summary & Key Takeaways

  • Before DBMS, data was managed with file systems, which are still inbuilt in operating systems such as CIFS and NFS. In the 1970s scenario, a single user saved and accessed their own data on their own system, so organizing it into drives, folders, and subfolders in hierarchical form worked well.

  • Client server architecture changed the requirement. Data now sits on a centralized server and users all over the world access it at once. Under those conditions a file system breaks down, because pulling a whole 25 GB file to retrieve 1 KB of train details wastes memory and time, while an SQL query returns only what was asked for.

  • Five points separate DBMS from file systems: faster and more efficient searching, freedom from needing metadata attributes like file name and location, concurrency protocols for simultaneous access, role based security instead of a single OS login password, and constraints such as primary and foreign keys that prevent data redundancy and support data integrity.


Read in Other Languages (beta)

Share This Summary 📚

Explore More Summaries from Gate Smashers 📚