So in this lecture we are going to compare DBMS with file system or you can say we are going to see drawbacks of file system or you can say we are going to see the advantages of DBMS. So you can write down the points whatever points I will discuss in this lecture in answer of three type of questions right. In the previous video I have already discussed the some fundamentals of DBMS like what is data, what is information, what is database, what is DBMS, what is purpose of DBMS This means why we need DBMS and some advantages. and drawbacks we will discuss in this lecture. In the previous video, I have also discussed some applications of DBMS, right?
So now first point is, first of all, what is file system? See, if you are using a computer, then you are definitely using a file system. File system comes with your operating system and we don't even know that we are using that file system and how it works, but we are using file systems, right?
It is what? It is going to manage the file or the data we are going to store. See in the system how we are going to store the data.
Maybe we have some drives C, D or E drives or there we have folders and we have sub folders and there we are going to store our files or some maybe notepad file, wordpad file, excel file something like this. Right. So this is what the management of this data is what the role of file system only.
We are going to store the data using file system only. Right. DBMS is also used to manage the data and file system. It's also used to manage the data.
Now, what is the difference between these two? See here in file system, suppose I have created a file, a notepad file. It is having some value like one and there we have Jenny's lecture and two after that I have written Jenny Lamba means name of my second channel. Right now, how are you going to store this file into your hard drive, into your hard disk?
between hard disk and this file we have first of all file system this file the response it is the responsibility of file system to save this file to manage this file so it is you can say interface type of thing between hard drive or your hard disk and you right so now we are using file system and we don't even know right if we don't use if file system is not there in your operating system then then the complete data would be a you know it's and only one time at one place and it is very difficult to manage that data to search something or to access that data right it's because of the file system only we are able to partition our drives we are able to create the folders so you can say directories subfolders and files right so that we can manage our data to somewhat Right, but we can manage the data, a short amount of data, when it comes to a large or huge amount of data, then file system is not a good idea to use. There we will use DBMS. suppose if you have have you have installed a software or DBMS on your system like maybe you can say MySQL or SQL server Oracle 9g or 10g or you can say DB2 many types of DBMS softwares are available right now suppose I have MySQL now here suppose I have created one table and there I have stored one now this is the table basically we are dealing with we are talking about rdbms that is relational database management system there we are going to store the data in the form of relations or tables and every table is having relationship among them right now i have created user Using some, how you are going to create it? Obviously we will use what? SQL, that is structured query language.
We are going to write down the queries in SQL and to access this database. So to perform some operations on the database like insertion, deletion, manipulation, all type of operations. right for that we are going to use sql language structured query language now this table is also going to be stored in obviously hard disk now there also we have file system it's not like that we have removed this file system from here obviously we have file system on our pc right but now for managing this data for managing our database we are using dbms and here Here for managing a database, we are using file system.
It's not like that. We have completely removed file system and we are using DBMS. That is very important point.
We still have file system, right? First of all, this, obviously we have DBMS. This is my SQL, right? There I'm going to create a table and that will go to file system. And that after that, it will be stored in hard disk, right?
But only difference is what? Here for managing the data, I'm... using DBMS but here for managing the data simple file system is responsible right now why we have switched from here to here why we are using DBMS for managing the data obviously the file system cannot manage the data efficiently right if small amount of data is there.
In the last video, I have taken an example that I have 10 friends and I want to store the phone number, age and address of only 10 friends. Then obviously no need to install a DBMS. Only we can make a notepad file there I can store.
name of 10 friends their phone number their age and their address and i can store if i want to access then simply i can access that if i want to search something then obviously the data is very small so i can easily search so only by using the file system i can manage my data but suppose you can say it's a hospital management system there we have multiple tables tables for patients for doctors for registrations or for other helping staff for inventory as well many information we need to store for all the information obviously we cannot make the tables right if we make the tables for this like we have many tables for hospital management system we have 10 to 12 tables maybe right in our database so only using file system can we manage all the tables obviously that would be a very problematic situation we cannot manage this table. That is why for management, managing this database for a large database we need DBMS right now what can be the problems here if we use file system for managing a large database see here the very first difference between this and this is what here the data is stored see directly this data is going to be stored in hard disk right have we defined any data type here that int data type or string or float or something like this? No.
So as it is the raw data is going to be stored in hard disk that is data here is unstructured data. Means here unstructured data is what? The data which is not structured using some predefined data models or schemas.
Right here we don't define any data type or any constraint on the data. Right that is unstructured data. Unstructured data may be in the form of text or it may be non-textual.
it may be audio, it may be maybe video, YouTube videos, or you can say unstructured data may be collected from social media, that is data from Facebook or data from Twitter or from LinkedIn, or maybe through that chat, WhatsApp data, or you can say that Instagram data, that is what unstructured data, right? We don't have any proper, you know, definition or predefined structure of that data, right and now in today's world 80% of data is unstructured data right but now in this case see here when you are going to create this table then you will have to define you will define the name of the table the data type here we have integer here we have maybe string or maybe in another column you can say float or the name of the columns and something like this now if the data type is integer then here you cannot store suppose I am going to store A here then that will give error So here the data is predefined. We are going to structure the data in a proper way. So here we are dealing with structured data. This is the very first and basic difference between this and this.
And obviously, if the data is structured in a proper way, then searching would be very easy on a structured data rather than unstructured data. And in today's world, we are dealing with unstructured data means 80% of the data. data is unstructured data right so where it is going to be used in data mining right how we will use this unstructured data in data mining we will use some mining tools and we will extract some patterns like for example when you go for shopping in a mall then you always noticed i guess you have noticed that in one shell if bread is there then In the next of this bread, they are not going to put any shampoo or they're not going to put any stationary items like this. Nearby this bread, they'll put either milk or you can say cake or something like this.
Right. So that's what they are. They are, you know, they have the pattern that if someone is going to buy a bread, then 80 percent of chances are there. he'll buy maybe jam or milk something like this so these kind of things they'll put together right so that's what where data mining comes into picture and the unstructured data comes into picture but that is a different subject that is data mining and data warehousing that i'm not going to discuss that thing in deep here we are discussing the difference between file system and DBMS. So, Here one problem may be because of the unstructured data is see different people means different format they are going to follow or maybe if same people is same person is using that data means I am the user and I am creating the data on my laptop and I am using that data.
I am responsible for managing that data. Like user is responsible for managing that data. Right.
So now here suppose in one file I have stored the date in this format. Right. And at one file I have stored date something like this so maybe format is first of all I'll store month then day then year and format may be first of all I'll store day then month then year there is no specific format defined right so that would create a confusion right maybe here we have more than one table means five ten tables there i can store one in one file i can store in this format in another file i can store in this format then that would be problematic situation right now next point may be see if i want to access this file i have stored this file somewhere i want to to access this file obviously I can access the file here using any programming language you can write down a c program you can write program in c plus plus or java something like this and you can access this file right but for this the problem is you need to know the location of this file in which drive in which folder this file is stored after that only you can access this file right so here you need to know the file location right so now it's fine if i am the only user and i am accessing the data on my laptop so i know where the data is but if more than one user is accessing the same data means in nowadays we are using what that client server architecture right here something like this the data is stored on the server here and many users are there or you can say clients are there all over the world who are using this who are accessing this database right which is on server now obviously i don't know where the data is because data may be present at remote location fine like this only i don't don't know where my YouTube videos are stored.
I don't know the location. You don't know the location. If you want to search something, you simply write down the name means the topic name and you will get the information.
You don't need to know that where that data is present in which server, the server, which is in India or the server, which is in USA, you don't even know. Right. So that is the beauty of DBMS.
You don't need to know the location of that data to access that data right so that is the second difference now here third point is what see suppose in my file i have multiple data and the size of file is around 20 gb and here i want to access only small information that is of 25 kb only right only one row suppose i want to access now here obviously for accessing this you need to write a program in c language suppose you are writing a program so for that thing when you write a C program then you will access this complete file. This complete file would be transferred to you. Right.
But I don't want a data of 25 GB. I just want information of 25 KB only. So that is problem in file system. Right.
Now in DBMS only you can get this information. You will not get the complete file. You will get only this information that is of 25 KB only.
The information you want from that file. right that is another advantage of DBMS. Next point is here in file system, how to access the data?
We are going to write proper program, maybe in C language or any language, right? So suppose a bank is using file system, not using any DBMS. And there, obviously we have multiple tables.
And from here, I want to access the information. My query is I want to access the name of those account holders, those persons whose account is having having a balance less than 1000. Right? So there we cannot write down a query.
There we have to write down a complete program and obviously I can get this result. Now my second question is I want to access the name of the program. Those persons whose account is having a balance greater than 1 lakh. right now for that you have to write down what another program and you have to compile that program and after that only you can get this result so for each query you are supposed to write down a complete program that is not a good idea but here only you need to write down a simple query and you can get this result after that again a simple query and you can get this result no need to write down and no need to compile a complete program right so here in file system you can right here file system allows only that predefined pre-determined access to the data that is using some compiled programs right here in dbms if you are using dbms then here the flexible access of the data is possible right next point is data redundancy means data duplicacy duplicate data is present in may be present in file system right in the previous case also we have discussed in the previous video that suppose I have this table I have have 10 friends and the data I'm storing is name, phone number, age and address. Now suppose I want to show this data, I want to share this file with another user, another friend of me and I want to show the phone number, right?
Then what can you do? You can create another file and from there you can delete phone number and in that file we have this, this and this. So now we have two files, one is this one, one is another one which is not having phone number.
Now to another person I want to show this file but i don't want to show the age or you can say i don't want to show the address then i can create another file f3 and there that file will contain these three columns and it is not containing address i have deleted this so now i have three files now this is what data redundancy data duplication now what is the use of storing the same data again and again so that is the problem in file system for making this file secure because i am obviously creating these file for security purpose. I don't want to show phone number i don't want to show address but now the problem is data redundancy that have created another problem right or here you can take one example like one faculties one faculty is taking subject in csc and ec department right here data structure here suppose dbms and the faculty name is same suppose you can say jenny and jenny so all the details of jenny would be same but here we we have two files two locations in CSC department also in ECU department also the same information is stored right now this is what data redundancy fine no need to store the same the detail of same faculty at two place so now because of this redundancy another problem is inconsistency now what does this inconsistency means now suppose this faculty has left the college right So they have updated in this table, right? In CSA department. department and they have deleted the profile, but this profile is still in EC department.
So data is now in consistence, right? It should be updated in both the tables or in maybe all the tables, the changes should be reflected in all the tables. So manually it is very tough if you have 10, 15, 20 tables and all the tables are having some information related to me, then from all the tables that information should be deleted.
So that would be a tough job if you are not using DBMS. So now next is concurrent access. Suppose there is one file and many users are accessing this file. This is what concurrent access. Right?
So that would be problematic in file system. Why so? Because see suppose two users are reading this file then that is fine. There would be no problem.
But if one is reading one is writing. Right? That is read write or one One is writing, another is reading.
or one is writing, another is also writing, then that would create a problem, right? So here we should have some concurrency protocols, like some locking mechanisms. If one person is writing or updating this file, then other person cannot read that file. After completion of the writing, after completion of the updation, another person can read that file, right?
That should be a case. Now in file system there is no concurrency. concurrency protocols. But in DBMS we have concurrency protocols that thing also we will discuss one by one in later videos. So concurrent access is a problem in file system.
So now here you can also say we will not allow multiple user to access the file right at one time only one can access that file either read or write but that is also not possible in nowadays because see suppose you are I'm Taking an example of railways, suppose at one time only one person can book the ticket or only one person can access that site or something like this, no concurrent access to this railway database, then that would be obviously a problematic situation. Because I guess in one day around seven to eight. Lacks, bookings are there on this railway, right? So concurrent access is must nowadays on database, right? You have to implement concurrent access.
And for avoiding the problem, you need some protocols. And those concurrency... protocols are there in DBMS they are not in file system next point may be integrity see on DBMS on the data I can you know allow I can add integrity constraints like what suppose in a banking system I want to add a constraint like this if your balance your bank balance goes less than thousand then automatically 25 rupees will be detected something like this these kind of constraint I can apply on the data in DBMS because in DBMS the data is predefined.
When we are going to define the data then only I can put the constraint. But here in file system the unstructured data is there. We cannot define anything on that data. So integrity problem is also there in file system. Next issue is security.
Security of data is less in this file system. Here in this example only you can show that security. security is not much in file system or you can say here we can put obviously we can put that read write permission on the folders and files but we cannot put these kind of access permission on a portion of a file on small portion of a file we can put this on a complete file or folder right but in DBMS it is possible right the mechanism for security is much more means for backup mechanisms for recovery mechanism is also there there in DBMS that is not possible in file system if we you know want to back up the data means backing up the data in file system is very tough why so because data is unstructured data is not predefined but here backing of the data is easy in this example only security is there if you don't want to show the phone number then simply you can write down a query you can fetch name age and address and you can show another user so that is data is more secure in DBMS it's not a case in file system to making it more secure either you have to create another file and from that file you can delete phone number but in that case it will create a problem of data redundancy and as well as data inconsistency right so now here on the basis of these points i have compared file system and dbms there you can say maybe you can write these are drawbacks of file system or you can write these points as in advantages of dbms right i'm not saying that these are the points point these are the only points for comparison of this file system and DBMS you can compare these on many more points also in next video I'll discuss about functional dependencies means what is functional dependencies and after that we will start normalization so now I'll see in the next video till then bye bye take care