What is NoSQL database

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey there everyone with a shear back again without the video and in this video we are talking about no SQL yes I know most of you have already heard the term no SQL and when the first time you have googled it it just appeared and has given you a search result that says not only SQL and it's a perfectly correct term these kinds of databases has evolved in the recent years and they are little bit different from our conventional relational database type these are the newer ones but there is a lot more that you need to understand about them so let's get started now in order to understand what actually is no SQL why it has evolved and what kind of benefits it provided us we need to go back in to the time where there was just only one type of databases the relational type conventional SQL or relational databases our result of years of hard work best practices and decades of stress testing that has been done on these databases they are designed for reliable transaction and proper structure of data that needs to be stored in them now this so much of the rigidness of the proper structure of storing the data as well as so much reliability on the successful transaction of any query that we are making has also given birth to some of the limitations that are actually in the relational databases now don't get me wrong here relational databases are still among well the most used databases on the planet so many applications already have been designed in it and are still using it it's amazing and also when I'd say the term that compared to relational databases these modern no SQL databases can perform really fast don't get me wrong about there because these relational databases can handle thousands and thousands of queries in just fraction of seconds but what we are talking about is not the queries that you and me are making for a small scale website what I'm talking here is about these gigantic website that throws billions and trillions and gazillions of queries within a small amount of time websites like face book Amazon and Google their transactions of these queries is in numerous these no SQL databases actually arose to get rid of some of the limitations that were there in the relational databases and mainly focusing on two things first high operational speed and second is flexibility in storing the data yes there are many other features in them but these two are the most common things that gave birth to these no SQL databases now most of these know SQL databases has been founded by these big companies like Amazon Facebook and Google because they first and foremost felt the need that there should be a database that should be following these two practices high transactional speed and flexibility of data now here's a one thing which I would like to point here now relational databases are all amazing but there is one one big problem with them which is scalability now if you ask any database administrator who has been working with the relational he'll say that it's all amazing until and unless our company felt in need of scalability yes surely we can apply more hardware but that's not the point we want a scalability in a horizontal level and these no SQL databases can be scaled on a horizontal scale like like endlessly now if you'll ask me the difference between the no SQL and the relational databases it's actually not that complicated it's far more easier in the no SQL databases we focus on a predetermined structure known as schema where all the data or the properties or whatever the value that is is going to come in to the databases we follow that already we have defined a structure this is what it comes here if any other data comes up we have no place actually to store that data and in some application that's exactly what we are expecting this is schema is a formal definition of how data is going to be structured and is going to be stored at some places we expect that it should come as an integer it should always come as an integer and there is no exception for that well on the other hand if I talk about the new SQL databases in no SQL database the data is structured and stored in a free-form format now this freeform format can be simply like a JSON or but don't pick the word here because it can be stored in variety of other formats as well Jason is the most common one now in the new SQL databases even if the data which you are not expecting is going to come up you don't need to rewrite the entire structure you can eventually just at that point end and at that moment you can go ahead and store that data okay so that's the most common and fundamental thing that you need to know about the new SQL so what are the more things that you should know about the new SQL databases now no SQL databases are categorized broadly in four categories but hey again some of the books and some of the reference point you'll see that there are even more categories but the whole fundamental whole core point of these no SQL is divided into four categories the first and the most common one among all these categories is document database the example could be MongoDB which is my personal favorite in these kind of database you just collect the entire data that you want to store the entire structure is in JSON format even if the new data comes up you just create a new object and that is stored in a whole gigantic big object really the fun one to work with them very easy to understand their structure very few queries that you have to like learn and all these things a very small learning curve and these are kind of my personal favorite one now next up in this category is a key value database now there can be other names for that as well but the whole idea is everything in this kind of database is stored in key value pair whenever you want to access something you just mention your key and your value will be produced the example could be like Redis database next up the third category is wide column database now in this there's a strange thing that happens everything is stored in columns instead of rows that we are kind of familiar with the relational databases now the example could be Cassandra and these are one of the most powerful ones because they can store anything in column and at this this can be actually scaled horizontally like endlessly and the fourth one and last one is little bit complicated at first to understand and it's a node based database structure now some call it as a graph database as well but again regardless the terminology the whole point is if thing is stored in point in the format of a node your data is also going to be stored in the format of node and that node is also going to store your relation with the other points that you want to anchor now yes it's a little bit complicated to understand at first but one of the example is neo4j now these databases once you understand it can be like really amazing but also I would like to make a point that these databases like neo4j is not for a small scale application these are for somebody like Facebook who has so many endpoints so many nodes so many connections with the data so neo4j is one of the ideal database that should be used by Facebook and of course it is being used there ok so now that you understand quite a lot about the new SQL the obvious question is when you should be using no SQL and when you should be using relational databases now for most of the small scale applications still the relational database is amazing but when it comes to your startup whatever you are trying to design or your product now it comes to a variety of things companies spend months and months to decide what is going to be the stack of their technology because it's not about the favoritism it can be not about like my favorite is Java his favorite is Java Script and his favorite is Swift so we are going to use all of them no it's not about that at the end business decision are based on money and how easily you can find developers for them so companies do spend a lot of time in that now once they have decided that this is going to be our stack and all the research goes good for the new SQL and their purpose then only it has decided that it's gonna be no SQL or maybe relational databases now usually when the companies are much more worried about the fast access of their data and how the structure is going to be lied this is the main point when they decide whether it's going to be no SQL or relational remember that MySQL the relational databases are still faster but again when you compare the speed with small transactions no SQL proves to be a little bit more faster side when you have fast access and flexibility of the data or maybe your startup or your company is looking forward for the scalability solution you know you are pretty sure that you will have plethora of users and eventually scalability it could be a night for you that is one on the point where you decide that hey I'm gonna go for no SQL okay so now you know quite a lot about the know SQL the obvious question that might be pondering in your mind is that in the new SQL we get such a high speed when we want to access the data we get the flexibility of storing the data as well plus the scalability is amazing so why don't we just use no SQL everywhere and just abandon these relational databases that's actually a good question now actually all of these points are correct and at some point of degree you are right that we should use the SQL but let me tell you one thing not everything in this life and this world is all sunshine and rainbows things always come with their limitation with their pros and cons and what are the advantages here in the new SQL are actually its downside as well there are still many such applications which are so complex as well as so and requires so much of the constraints about these transactions and their reliability on the transaction and their safeguards that relational databases are much more better now of course no SQL is all amazing but the whole property the asset property I highly recommend you to google a little bit about the asset property of databases now these asset properties are compromised a little bit in them no SQL while the relational databases they are whole rigid about that so eventually these compromises in the acid property are actually the downside of no SQL so in your application if you are highly reliable on the transaction status that it should be no failure at all and it should be so reliable and I need all the safeguards in my application then you should always prefer relational databases now this doesn't means that no SQL is gonna fail your transactions and it's gonna make a mess no it's not like that but compared to no SQL relational databases are still much more hard tested and stress tested as compared to the new SQL now quickly just onto a very last point I would like to quickly compare the typical relational database mysql with the typical new SQL database MongoDB so here is a quick chart and in the chart you can see how we can compare the analogue about the document the rows columns and what they are called in it this is a good chart and I highly recommend to pause the video and at least have a look on it relational databases and no SQL this is always a healthy debate and I always like to take part in it so if you have some points about the relational databases or no SQL I would like to read that in the comment section these are some of the topics that I expect that every computer science student should be aware of and should be able to talk about them I'll come up with more such topics very soon at this channel so stay tuned if you haven't yet subscribed to the channel make sure you do that that's it for this video and let's catch up in the next one [Music]
Info
Channel: Hitesh Choudhary
Views: 106,090
Rating: 4.8963532 out of 5
Keywords: Programming, LearnCodeOnline, nosql basics, what is nosql, mongodb, myssql, relational vs nosql
Id: AWEUeucIiWA
Channel Id: undefined
Length: 11min 57sec (717 seconds)
Published: Sat Jun 23 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.