SQL vs. NoSQL Explained (in 4 Minutes)

preview_player
Показать описание


Trying to decide between SQL and NoSQL for your next project or system design interview? Learn about well-structured data, ACID compliance, and horizontal scaling considerations.

The strengths of SQL databases include their relational nature, well-structured data, and ACID compliance. Still, they could be more effective for storing and querying unstructured data and challenging to scale horizontally.

NoSQL databases are more flexible and better suited for storing unstructured data, with horizontal scaling made easier by distributed databases. However, NoSQL databases can suffer from eventual consistency issues in write-heavy systems.

Chapters (Powered by ChapterMe) -
00:00 - Choosing databases in system design interviews
00:40 - SQL database strengths and weaknesses
01:43 - SQL databases take longer to set up, scale, query
02:13 - Benefits of simpler databases
02:53 - Tradeoff between strong database consistency and scalability
03:44 - Database techniques and exponents summary

Watch more system design videos here:

ABOUT US:
Did you enjoy this interview question and answer? Want to land your dream career? Exponent is an online community, course, and coaching platform to help you ace your upcoming interview. Exponent has helped people land their dream careers at companies like Google, Microsoft, Amazon, and high-growth startups. Exponent is currently licensed by Stanford, Yale, UW, and others.

Our courses include interview lessons, questions, and complete answers with video walkthroughs. Access hours of real interview videos, where we analyze what went right or wrong, and our 1000+ community of expert coaches and industry professionals, to help you get your dream job and more!
Рекомендации по теме
Комментарии
Автор

I don't know but as a beginner I have noticed many of these videos LACK the most important sauce : ACTUAL USE CASES! If you would have featured examples like let's say you're building an app that does this or that for you might want to use SQL for this part of the scope BECAUSE etc... and for that part of the scope NoSQL might be preferred because etc.... There you go, I have just shared a framework for your next video lol. Thank you anyway for the content it shows the genuine interest to educate but could be better especially if you want to educate beginners.

dreamsachiever
Автор

I'd take two examples to give some clarity on how you apply the principles explained in the video to decide on real-life situations:

1. Designing a social media system like Facebook. Consistency is not critical. Posts can be created and it's totally fine if they take some time to propagate to multiple users. Considering the post data will be mostly unstructured data (text/images/video) and that you will need horizontal scalability (billions of posts), you should use a no-SQL database.

2. Designing a payment system like VISA or Mastercard. Consistency is of utmost importance while committing the transaction. If there is issue in reflecting the transaction information, it can lead to unwanted consequences and angry customers. Considering that the data is structured and you don't need multiple users to see a single transaction, you should use a SQL like database.

AjaySharma-mesy
Автор

The points mentioned are informative but add bit more clear explanation here about the horizontal and vertical scalabilities of NoSQL and SQL database systems:
NoSQL databases are designed to scale out horizontally, meaning you can add more servers or nodes to the database cluster to handle increased data volume, traffic, or performance requirements. On the other hand, SQL databases often scale up vertically by adding more CPU, RAM, or storage capacity to a single server to handle increased demands.

WaliSayed
Автор

SQL databases can also scale horizontally as well. People could get in trouble during the interview, please clarify this point

petar
Автор

@1:12 MongoDB is also ACID-compliant after version 4.

pranavjoshi
Автор

I have never needed to implement a NoSQL database since I normally design my datasets correctly before development.
When I tried to learn about NoSQL I found out that the lectures I was taking were leading me to "replicate" a relational structure in a NoSQL database.

But, that's just my case. I can tell that everything will depend on the context.

TecDM_EC
Автор

Its very informative video ❤.
But it could be better to add few use cases to use sql vs nosql in system design context.
I think:
Use sql db if acid property, more relational data and less need of scalability is there else use nosql db.
Correct me if i am wrong.

Deepakkumar-dyen
Автор

Very precise to the points of differneces between sql and nosql. thanks for the good content as always❤

vinaygupta
Автор

So much valuable information in only 4 minutes

abdullokhayrulloev
Автор

so, is it a standard answer the the question of "Could you tell the difference between SQL and NoSQL"?

jasonl
Автор

great video. A few people have ability to teach!! You have it!!

gusinthecloud
Автор

Nice explanation maam. Love from INDIA

rahulkumarmandal
Автор

Some of the qualities ascribed to SQL and NoSQL DBMSs are actually not intrinsic to them but orthogonal. ACID is one such example, that quality has nothing to do with whether the data is in tables or not. Both SQL and NoSQL DBMSs can be ACID, and both can be not ACID. For example, MySQL with the MyISAM table store is SQL but not ACID. For example, some key value stores etc are ACID. Also the ability to be distributed or not can be the case with both SQL and non. For example, Amazon Aurora is SQL that is distributed and horizontally scalable.

drndn
Автор

Thank you for the amazing video. I now understand it better than I used to.

FabioGoncalves-ryzq
Автор

I regard you as a very credible and lucid presenter.

michaelbradley
Автор

Well Exaplanation ma'am❤! Now I've understood differences b/w SQL and NO-SQL. Thank you ❤

apnashankar
Автор

In my experience, and I did not make the decisions, but NoSql, is used for HUGE databases, with very few tables, and often the data is mostly static. Or at least, only a few records change in a day. And note, the Daytona database solution, had a weird ability to have an unlimited tuples in the same field, all on the same record, since, under it all, the database tuple, was text. So, anything you say about SQL databases, only applies to most of them and not all. The largest, and oldest database, is in Daytona and Cymbol.

normbograham
Автор

No-SQL database can easily solve the "consistency" problem by implementing structures or schemas internally

adityyyaaa
Автор

why dint you cover CID(consistency, Isolation and Durrability) for sql? why only atomicity you explained?

VishalGupta-mnmn
Автор

NoSQL databases were not originally intended for scenarios requiring strict data integrity, as ensuring data consistency across distributed systems can be complex. The best use case for NoSQL is often for data caching mechanisms, where a disconnected application stores data in a NoSQL database and later synchronizes it with a relational database like SQL Server, Oracle, or MySQL. Using NoSQL as a caching mechanism also enhances performance, as you can keep a list of products in a NoSQL database and refresh it only when changes occur, thereby limiting the number of server data requests. This approach effectively functions as a caching mechanism. In conclusion, the use case where the technology shines is a hybrid application.

rolandocedeno