In the Computer Science track at Worcester State, and as a prerequisite to this course, students have to take a Database Design course that teaches SQL. Because of this, before this course, when databases were mentioned, it typically invoked thoughts and memories of SQL queries and database management using the SQL language. However now, the project being made works with the use of MongoDB, a NoSQL database management system. This made me curious about the differences between managing databases with and without SQL and when it is smarter to use each.
I watched a video called, “Which is Better? SQL vs NoSQL”. The key point I took away is that SQL is a relational database whereas NoSQL, such as MongoDB, is a document database. The key differences being that relational databases store information in tables with keys whereas document databases store information in documents with JSON data. One main benefit of a document database such as MongoDB is that it is much easier to store unstructured data. This adds flexibility at the expense of being able to use simple commands such as JOIN which can be used in SQL.
Another core advantage of NoSQL databases is that they can handle having multiple people connected to them at the same time. SQL databases on the other hand do not manage this well. This fact gave a lot of clarity as to the usefulness of using MongoDB over something like MySQL for the purposes of Thea’s Pantry.
The video also mentions that NoSQL databases are better at scaling across different servers which can be useful if we need to write information across multiple platforms and in many places.
Overall, from what I understand, SQL tends to be stronger for performing more in depth and informative queries on a set of data, at the expense of requiring the data to be organized and consistently formatted. NoSQL, on the other hand, does not have the inherent ability for users to submit queries on the data but it allows for lack of format and consistency and that leniency provides more flexibility for data storage.
The ultimate conclusion was that both SQL and NoSQL databases are powerful in the hands of the right user. While they each have their strengths and weaknesses, they are similar enough to allow users to perform most of the same tasks on either one and that allows developers the freedom to choose the database that they are more comfortable using for the purposes of any project.
From the blog CS@Worcester – The Struggle of Being a Female Student in CS by Noam Horn and used with permission of the author. All other rights reserved by the author.