In computer science, a database is an organized collection of data, a structured way of collecting and storing information. It is based on the DBMS (Database Management System), which means you can create, delete, edit, and retrieve data. The DBMS software manages everything, including the storage.
I’m not diving deeper into this. You can read more by searching on the internet.
In 1970, E.F. Codd introduced Codd's 12 rules (actually 13, because they start from 0 to 12). He designed these rules to define what qualifies as a relational database. If a database follows these 12 rules, it falls into the category of a relational database. There are multiple databases that don’t strictly follow all these rules but are still called relational databases. MySQL and PostgreSQL are the most commonly used in this category.
MySQL was created by Michael Widenius. He has three daughters: My, Max, and Maria. My is the name of his eldest daughter, which is how MySQL got its name. Later, he created more databases, like MaxDB and MariaDB. MariaDB was a fork of MySQL.
After some time, Sun Microsystems acquired MySQL, and later, Oracle acquired Sun Microsystems, so now Oracle manages MySQL. This isn't typically asked in interviews, but it's good to know for your curiosity! read the full history
Another scientist, Michael Stonebraker, was working on a project called Ingres at the University of California.
He left the university around 1985 and started a new project called Post Ingres. This project focused on SQL (Structured Query Language), and eventually, it evolved into what we now know as PostgreSQL.
Now that you know about different types of databases and their history, you understand they are organized and structured. To manage these databases — to create, read, update, and delete data — you need to perform operations called queries. For that, we use a language called Structured Query Language (SQL).
Don’t get confused with "sequel" or "prequel" — it's not related to movies! Some people pronounce SQL as "sequel," but it stands for Structured Query Language, not related to cinema, haha!
Types of NoSQL:
MongoDB uses the Document type of NoSQL database. Some people call it "Not Only SQL" or "Non-SQL," but the naming varies. The key difference is that it doesn’t operate using Structured Query Language (SQL). NoSQL databases came into existence around the 2000s.
MongoDB was created in 2009 by a company called 10gen. The name Mongo comes from the word Gigante, meaning "huge," because it can store a massive amount of data. Later, the company 10gen shifted its focus to MongoDB and renamed itself to MongoDB Inc.
MongoDB quickly evolved and became popular, as it emerged around the same time as Node.js. It felt like Node.js and MongoDB were made for each other, which increased developer productivity. MongoDB is built using C++ with some JavaScript code as well.
Relational databases store data in rows and columns. "Relational" means that there are relationships between different tables. For example, in a student table (as shown below), there might be another table called hobbies. The student_id in the hobbies table is related to the student table because each row in the hobbies table is linked to a student. The student_id is used as a foreign key to create this relationship, which is how relational databases work.
In MongoDB, we have collections that function like JavaScript objects or JSON data, but in MongoDB, they are called Documents. The keys in MongoDB are referred to as fields. In MongoDB, there is no need for data normalization or joins, and there can be multiple collections.
I am just pasting the image. Please Google it to learn more. To be honest, I’m tired today as I just came back from somewhere and don’t have the energy right now. Sorry this time, I’ve written quite a lot already.
And that's all for this episode!
I'm Rahul Aher, and I'm writing digital notes on Node.js. If you enjoy these notes, please share them with your friends. If you find any errors or have improvements, feel free to contribute by forking the repo. If you're interested in writing the next episode's notes, fork the repo and contribute. Let's learn together! Also, please consider giving a star to this repo. For any queries, let's connect here.
Thank you so much for reading. If you found it valuable, consider subscribing for more such content every week. If you have any questions or suggestions, please email me your comments or feel free to improve it.
I'm Rahul, Sr. Software Engineer (SDE II) and passionate content creator. Sharing my expertise in software development to assist learners.
More about me