
- Software Engineer, Product
- Modern Technology stacks:
- So What is a Tech Stack?
- Frontend tech stack
- Backend tech stack
- How to choose/build a tech stack
- What is a CI/CD Pipeline?
- Software Business Analyst
- Node.js Express Back-end Overview
- Build React App With Java Backend
- Connecting React-Frontend and NodeJS/Express Backend Applications
- React-Frontend, Node.js/Express-Backend, MySQL Architecture
- React Frontend with a NodeJS/Express Backend
- So What is git ?
- Git vs GitHub
- Big O Notation


Database Comparison:
SQL vs NoSQL ( MySQL vs MongoDB)

Hi, I am Jama Hassan. In this visionary article, I will talk about SQL and NoSQL using MySQL and MongoDB. This will be useful if you are new to SQL or NoSQL.Or if you are looking for the difference between MySQL and NoSQL.
At the end of this blog, you will be able to identify what is the exact difference between SQL and NoSQL using MySQL and MongoDB. And you will be able to know the use cases of each database structure.
2.Different Between SQL and NoSQL
3.What are MySQL and MongoDB
4.Use cases of each database structure
Let's start with knowing SQL and NoSQL first.
1. What are SQL and NoSQL?
SQL stands for "Structured Query Language". This language is used for communicating with a database.
SQL is the standard language for relational database management systems according to
the ANSI(American National Standards Institue).
SQL statements are used to conduct operations such as updating or retrieving data from a database.
SQL is commonly used in relational database management systems such as Oracle,
Sybase, Microsoft SQL Server, Access, Ingres, and others.
Although most database systems employ SQL, they often have their own proprietary extensions that are exclusively used on their own platform. Standard SQL commands such as "Select" "Insert," "Update," "Delete," "Create," and "Drop" may be used to perform nearly anything with a database. This lesson will teach you the fundamentals of each of these commands and provide you the opportunity to practice them using the SQL Interpreter.
1.Users can utilize relational database management systems to access data.
2.Users can use this feature to explain the data.
3.Allows users to define and manipulate the data in a database.
4.Allows SQL modules, libraries, and pre-compilers to be embedded into other languages.
5.Users have the ability to build and delete databases and tables.
6.Allows users to build database views, stored procedures, and functions.
7.Permissions for tables, processes, and views can be adjusted by users.
Instead of the columns and rows required by relational databases, NoSQL databases store data as JSON documents. To be explicit, NoSQL refers to "not just SQL" rather than "no SQL." This implies that a NoSQL JSON database may store and retrieve data without utilizing SQL. You may also mix JSON's flexibility with SQL's capability to get the best of both worlds. As a result, NoSQL databases are designed to be flexible, scalable, and capable of quickly adapting to current commercial data management demands.
2.These databases offer flexibility for data that hasn’t been normalized, needs a flexible data model, or has various features for distinct data types.
3.They provide scalability for bigger data volumes, which are common in analytics and AI applications.
4.Cloud, mobile, social media and large data applications benefit from NoSQL databases.
5.For certain sorts of applications, they are built for specialized use cases and are easier to use than general-purpose relational or SQL databases.
SQL databases are general-purpose databases, whereas NoSQL databases are
designed for specialized use cases. The five major differences between
NoSQL and SQL may be summarized as follows: API, data model, schema need,
scalability, and data integrity. To these features of data storage and retrieval,
each takes a distinct approach.
The schema of SQL databases is set in stone, with strict data types and lengths for each column, and every row must conform to the predetermined column layout and structure. If a column is specified as an integer, for example, the DBMS will refuse any attempt to store data other than integers in that column. Because the DBMS enforces rules as data is added, this technique results in higher data quality.
Vertical scaling, sometimes known as scaling up, is a common SQL method. Vertical scaling involves adding more resources, such as a more powerful CPU or more memory, to manage a greater workload or increase performance.
The BASE technique is used by most NoSQL database systems to manage data integrity (Basically Available, Soft State with Eventual Consistency). Data may be inconsistent for a while while using the BASE, but database replication gradually makes all copies of the data consistent. Some programs can handle inconsistencies in data, whereas others cannot.
MongoDB is a document-oriented NoSQL database for storing large amounts of data.
MongoDB uses collections and documents instead of tables and rows,
as in traditional relational databases. Documents are made up of key-value pairs,
which are MongoDB’s fundamental data unit. Collections are the equivalent of relational
database tables since they include collections of documents and functions.
MongoDB is a database that first appeared in the mid-2000s.
MySQL is an Oracle-developed relational database management system (RDBMS)
based on structured query language (SQL).
A database is a collection of data that is organized. It might be anything from a basic grocery list to a photo gallery to a repository for a business network's massive volumes of data. A relational database, in particular, is a digital storage that collects data and organizes it using the relational paradigm. Tables in this architecture are made up of rows and columns, and connections between data items are all organized logically. An RDBMS is a collection of software tools that are used to create, administer, and query a database.
1. The table in RDBMS comprises the columns and rows that are used to store the data,
whereas the collection in MongoDB is the same structure. The collection is made up of documents,
which include Fields, which are key-value pairs.
2. In a relational database management system, a row represents a single, implicitly organized data item in a table. The data in MongoDB is saved in documents.
3. A column in an RDBMS signifies a set of data values. These are referred to as Fields in MongoDB.
4. In RDBMS, data is occasionally dispersed over many tables, and to gain a comprehensive picture of all data, a join between tables is sometimes established. Data is generally saved in a single collection in MongoDB, however, it is segregated using Embedded documents. As a result, MongoDB has no concept of joins.
- Database with a large community, significant testing, and a high level of stability.
- All major platforms are supported.
- There is replication and sharding accessible.
- Covers a broad range of scenarios
- The SQL dialect utilized is Procedural Language/SQL or PL/SQL.
- One of the most costly database options available
- Uses massive databases
- Simple improvements
- nControlling transactions
- All operating systems are supported.
- Designed for businesses and organizations with high workloads.
- User-friendly only for Windows and Linux
- nWhen faults are discovered, it is difficult to make corrections in the middle of the process.
- It's ideal for small-to-medium-sized businesses looking for a commercial database solution without the Oracle price tag.
- Free and open-source software
- Wide variety of operating systems compatibility
- Many third-party service providers and an active community
- ACID compliance is high.
- Uses just SQL.
- When your data doesn’t fit into a relational model, this method is preferable. It’s also great for handling massive datasets and conducting complex queries.
- Use for free
- Schema changeable
- Vertically scalable
- With simple queries, the performance is excellent.
- Add additional columns and fields without affecting the performance of your application or current rows.
MongoDB is great for businesses that are experiencing rapid expansion or have a lot of unstructured data. Alternatives to this NoSQL database are less well-known, such as:
- Cassandra by Apache
- BigTable on Google Cloud
- HBase (Apache)
There are many other Database Comparison - SQL vs. NoSQL (MySQL vs PostgreSQL vs Redis vs MongoDB
that are built in to provide additional functionalities and common use cases,
making a developer's life much easier. I hope you learned something new
At the end of this blog, you will be able to identify what is the exact difference between SQL and NoSQL using MySQL and MongoDB. And you will be able to know the use cases of each database structure.
What you will learn,
1.What are SQL and NoSQL2.Different Between SQL and NoSQL
3.What are MySQL and MongoDB
4.Use cases of each database structure
Let's start with knowing SQL and NoSQL first.
1. What are SQL and NoSQL?

Although most database systems employ SQL, they often have their own proprietary extensions that are exclusively used on their own platform. Standard SQL commands such as "Select" "Insert," "Update," "Delete," "Create," and "Drop" may be used to perform nearly anything with a database. This lesson will teach you the fundamentals of each of these commands and provide you the opportunity to practice them using the SQL Interpreter.
Why do we use SQL?
SQL is commonly used because it has the following benefits:1.Users can utilize relational database management systems to access data.
2.Users can use this feature to explain the data.
3.Allows users to define and manipulate the data in a database.
4.Allows SQL modules, libraries, and pre-compilers to be embedded into other languages.
5.Users have the ability to build and delete databases and tables.
6.Allows users to build database views, stored procedures, and functions.
7.Permissions for tables, processes, and views can be adjusted by users.
NoSQL
Rather than relational tables, NoSQL databases store data as documents. As a result, we categorize them as "not simply SQL" and divide them into several flexible data models. Pure document databases, key-value stores, wide-column databases, and graph databases are examples of NoSQL databases. NoSQL databases are designed from the bottom up to store and handle large volumes of data at scale, and they are increasingly used by modern enterprises.Instead of the columns and rows required by relational databases, NoSQL databases store data as JSON documents. To be explicit, NoSQL refers to "not just SQL" rather than "no SQL." This implies that a NoSQL JSON database may store and retrieve data without utilizing SQL. You may also mix JSON's flexibility with SQL's capability to get the best of both worlds. As a result, NoSQL databases are designed to be flexible, scalable, and capable of quickly adapting to current commercial data management demands.
Why do we use NoSQL?
Customer experience has fast become the most crucial competitive difference, ushering in a period of massive transformation in the commercial world. As part of this change, businesses are communicating digitally on an unprecedented scale — not only with their consumers, but also with their staff, partners, vendors, and even their goods. The internet and other 21st-century technologies enable this contact, and cloud, mobile, social media, big data, and IoT applications are at the center of the transformation.Using NoSQL databases has various advantages, including:
1.NoSQL databases make it easier to construct interactive real-time online applications, such as those that use REST APIs and web services.2.These databases offer flexibility for data that hasn’t been normalized, needs a flexible data model, or has various features for distinct data types.
3.They provide scalability for bigger data volumes, which are common in analytics and AI applications.
4.Cloud, mobile, social media and large data applications benefit from NoSQL databases.
5.For certain sorts of applications, they are built for specialized use cases and are easier to use than general-purpose relational or SQL databases.
2. Different between SQL and NoSQL
In the above section, we talked about SQL and NoSQL. I hope that you have a clear image of those database structures. Now let's see what are the difference between using SQL and NoSQL.
1. API
Although many NoSQL databases offer a SQL-like query language, SQL is not required as an API for the data in the database. SQL is frequently the main or primary interface to data in SQL databases.2. Data Model
Data is not represented as tables with fixed rows and columns in NoSQL database systems, as it is in SQL database systems. Instead, data can be represented as JSON documents, graphs with nodes and edges, or key-value pairs, depending on the NoSQL database. The table and row idea is used in wide-column storage, although columns can be dynamic from row to row inside a table.3. Schema
A NoSQL database's schema is flexible, which means the data, data types, and lengths for data pieces are not fixed. Data can be stored in a schemaless or free-form format. This method provides programmers with more freedom, which can make development easier.The schema of SQL databases is set in stone, with strict data types and lengths for each column, and every row must conform to the predetermined column layout and structure. If a column is specified as an integer, for example, the DBMS will refuse any attempt to store data other than integers in that column. Because the DBMS enforces rules as data is added, this technique results in higher data quality.
4. Scalability
Horizontal scaling, also known as scaling out, is common in NoSQL databases. Scaling out a system entails adding additional hardware, generally in the form of new commodity servers. In NoSQL systems, horizontal partitioning with sharding is commonly used to divide up huge databases into smaller chunks dispersed over numerous servers.Vertical scaling, sometimes known as scaling up, is a common SQL method. Vertical scaling involves adding more resources, such as a more powerful CPU or more memory, to manage a greater workload or increase performance.
5. Data security
Different mechanisms are used by NoSQL and SQL databases to ensure data integrity when it is generated, read, modified, and removed by applications and users.The BASE technique is used by most NoSQL database systems to manage data integrity (Basically Available, Soft State with Eventual Consistency). Data may be inconsistent for a while while using the BASE, but database replication gradually makes all copies of the data consistent. Some programs can handle inconsistencies in data, whereas others cannot.
3. What are MySQL and NoSQL?

MongoDB

A glossary of MongoDB terminology is provided here.
1. _id
Every MongoDB document must include the field _id. The _id field in a MongoDB document represents a unique value. The _id field acts as the primary key for the document. MongoDB will automatically construct a _id field if you create a new document without one. So, in the case of the aforementioned customer table, Mongo DB will assign each document in the collection a 24-digit unique number.2. Collection
A collection is a collection of MongoDB documents. A collection is the equivalent of a table in any other relational database management system (RDMS), such as Oracle or MS SQL. Within a single database, there is a collection. As stated in the introduction, collections do not impose any organization.3. Cursor
This is a reference to the query’s result set. Clients can retrieve results by iterating through a cursor.4. Database
This is a container for collections, similar to the container for tables in RDMS. Each database receives its own set of files on the file system. A MongoDB server may hold several databases.5. Document
A document is essentially a record in a MongoDB collection. Field names and values will be found in the document.6. Field
In a document, a name-value pair. There are zero or more fields in a document. In relational databases, fields are similar to columns. A Field with Key-Value Pairs is depicted in the diagram below.7. JSON
JavaScript Object Notation (JSON) is a kind of JSON. This is a plain text format for expressing structured data that is human understandable. JSON is now supported by a wide range of computer languages.MySQL

A database is a collection of data that is organized. It might be anything from a basic grocery list to a photo gallery to a repository for a business network's massive volumes of data. A relational database, in particular, is a digital storage that collects data and organizes it using the relational paradigm. Tables in this architecture are made up of rows and columns, and connections between data items are all organized logically. An RDBMS is a collection of software tools that are used to create, administer, and query a database.
Difference between MySQL and MongoDB

MySQL - Table
MongoDB - Collection
2. In a relational database management system, a row represents a single, implicitly organized data item in a table. The data in MongoDB is saved in documents.
MySQL - Row
MongoDB - Document
3. A column in an RDBMS signifies a set of data values. These are referred to as Fields in MongoDB.
MySQL - Field
MongoDB - Column
4. In RDBMS, data is occasionally dispersed over many tables, and to gain a comprehensive picture of all data, a join between tables is sometimes established. Data is generally saved in a single collection in MongoDB, however, it is segregated using Embedded documents. As a result, MongoDB has no concept of joins.
MySQL - Join
MongoDB - Embedded Document
4. Use Cases
Here, I point to some SQL databases and ideal use cases first. Then let's see about NoSQL databases.MySQL
- MySQL is a free, open-source database.- Database with a large community, significant testing, and a high level of stability.
- All major platforms are supported.
- There is replication and sharding accessible.
- Covers a broad range of scenarios
OracleL
- Professional administration, regular updates, and outstanding customer service are all features of this commercial database.- The SQL dialect utilized is Procedural Language/SQL or PL/SQL.
- One of the most costly database options available
- Uses massive databases
- Simple improvements
- nControlling transactions
- All operating systems are supported.
- Designed for businesses and organizations with high workloads.
Microsoft SQL ServerL
- Microsoft Transact SQL, or T-SQL, is the SQL dialect used to design and maintain commercial databases.- User-friendly only for Windows and Linux
- nWhen faults are discovered, it is difficult to make corrections in the middle of the process.
- It's ideal for small-to-medium-sized businesses looking for a commercial database solution without the Oracle price tag.
PostgreSQL
- It’s a hybrid SQL/NoSQL database solution since it’s an object-oriented database management system.- Free and open-source software
- Wide variety of operating systems compatibility
- Many third-party service providers and an active community
- ACID compliance is high.
- Uses just SQL.
- When your data doesn’t fit into a relational model, this method is preferable. It’s also great for handling massive datasets and conducting complex queries.
NoSQL Database Systems
With good reason, MongoDB is the most popular NoSQL database. It has the following qualities and benefits:- Use for free
- Schema changeable
- Vertically scalable
- With simple queries, the performance is excellent.
- Add additional columns and fields without affecting the performance of your application or current rows.
MongoDB is great for businesses that are experiencing rapid expansion or have a lot of unstructured data. Alternatives to this NoSQL database are less well-known, such as:
- Cassandra by Apache
- BigTable on Google Cloud
- HBase (Apache)

