DEV Community

Cover image for SQL vs NoSQL: What I Learned from a Live Tech Session”
Smarajit Pal
Smarajit Pal

Posted on

SQL vs NoSQL: What I Learned from a Live Tech Session”

I had a live session with Ankita Tripathi Mam, where She shared some of her knowledge on SQL and NoSQL Databases.

I gathered a Good amount of knowledge on the same. So, here is my take on the two widely used Databases.

SQL (Structured Query Language)

As the full form says, it is a structured way of storing data which is done in a vertical way in a table-based structure. Below is an example of how data is stored in the SQL.

This table is a form of SQL data storing where the top row is the attribute and below that there is data for every person like Name, Email,Phone Number along with the Id. If a new data of a person is added then it will be stored below the 3rd table under the same attribute.

When we require data then it is fetched using a query like this SELECT user_name, phone_number FROM customers. Here customers is the data set of all customers.
SQL databases follow ACID Properties (Atomicity, Consistency, Isolation, and Durability) which ensures reliable transactions and data integrity.
Some Examples of SQL databases are MySQL, PostgreSQL, Oracle, MS SQL Server.
Top companies, such as Netflix, Uber, Instagram, Flipkart, Amazon, and Linkedin, as well as many small businesses, leverage the Structured Query Language to extract information for data-centric analysis, database upgrades, and maintenance.

NoSQL (Non Structured Query Language)

As the name says, it does not have any structured way of storing data and it is done in a horizontal way. Below is an example of how data is stored in NoSQL.

Above is the example of NoSQL data storing where the attributes are different for different dataset. This is a key-value format of storing data. When a new dataset is added as a new object.

Some examples of NoSQL databases are MongoDB, Cassandra, CouchDB, Neo4j.
Top companies like Uber, Airbnb as well some industry like gaming, IoT uses NoSQL which is ideal for large-scale data and fast read/write operations helpful in real-time web apps.

Reasons for Using SQL and NoSQL

The basic reason is both has its own pros and cons .According to the requirement the correct database is selected which will compliment the requirement scenario.

SQL Databases: Generally, SQL databases perform well for complex queries, structured data, and systems requiring data consistency and integrity. However, as the volume of data grows, they may struggle with scalability and may require significant infrastructure upgrades.
NoSQL Databases: NoSQL databases excel in scenarios that demand high performance and scalability. Because of their horizontal scalability (accommodating more servers), they handle large amounts of data and high-velocity workloads better. For instance, MongoDB or Cassandra is a common choice when dealing with big-data or applications with high traffic.

Conclusion

Both SQL and NoSQL databases offer unique advantages, depending on the application’s requirements. SQL databases are great for structured, relational data where consistency and complex queries are a priority. On the other hand, NoSQL databases are better suited for flexible, large-scale, unstructured data handling and fast, scalable performance. SQL is ideal for data with well-defined relationships and consistency requirements.Ultimately, understanding both SQL and NoSQL lets us choose the right tool for the right job—just like every good developer should.

Top comments (0)