Why does NoSQL exist? (MongoDB, Cassandra) | System Design

  Рет қаралды 10,549

Interview Pen

Interview Pen

Күн бұрын

Пікірлер: 23
@professionalsd9647
@professionalsd9647 2 ай бұрын
I'm i missing something or he didn't design the model in nosql ?
@ssefrhd
@ssefrhd 2 ай бұрын
Exactly my thought as well..
@interviewpen
@interviewpen 2 ай бұрын
The schema shown is just an example to show the limitations of the relational model. Point is, NoSQL databases allow us to design around query patterns. The same logical data could result in very different schemas depending on the requirements or which database we choose. If you want to learn about non-relational schema design, you might want to look at our course on interviewpen.com :)
@mindrust203
@mindrust203 2 ай бұрын
@@interviewpen True, but I think I speak for most of us when I say we were expecting to see how you would design the NoSQL data model to solve the issues you mentioned, with regards to querying products in an order and getting the number of times a product appears across all orders.
@Fikusiklol
@Fikusiklol 2 ай бұрын
Good stuff! However, what is also important apart from schema, that relational database has relatively slow writes/updates because of their index structure (B-tree) and storage mechanisms. Apache Cassandra, afaik, has LSM tree and mem tables. MongoDB has async I/O journaling and also has LSM tree (or does it?) in addition to B-tree. I, personally, dont like any relational DB, but "right tool for the right job" :)
@charliebitmyfinger7124
@charliebitmyfinger7124 2 ай бұрын
Relational databases are also acid compliant and are by far the most reliable types of databases.
@Fikusiklol
@Fikusiklol 2 ай бұрын
@@charliebitmyfinger7124 NoSQL database are also acid compliant. It depends on what guarantees they provide, as every engine provides different guarantees.
@interviewpen
@interviewpen 2 ай бұрын
Really great insights, thanks!
@nandans2506
@nandans2506 Ай бұрын
Relational is more often than not the right tool for the job in hand. Use cases for nosql are very narrow in real world applications. It's good if you know your exact requirements and it fits the purpose. Most under development projects don't know exact requirements and they change with time, nosql will bite you for eternity
@ChoocoPunch
@ChoocoPunch 2 ай бұрын
Can I ask what should a NoSQL database table schema look like? Should it looks like 0:05 ?
@goldenlin9528
@goldenlin9528 2 ай бұрын
do most large scale companies use nosql then in favor of ease of storing and accessing data?
@interviewpen
@interviewpen 2 ай бұрын
Yep--companies that need to query massive amounts of transactional data typically use NoSQL databases for flexibility when distributing data across a large cluster.
@optimusdebugger9638
@optimusdebugger9638 2 ай бұрын
nitpick. We lost quantity when we went from model to table on order_product table
@ibrahimkoz1983
@ibrahimkoz1983 2 ай бұрын
Postgresql offers the same power as MongoDB when it comes to json, so there's no sense to choose MongoDB even if you want to store your data in denormalized form.
@ibrahimkoz1983
@ibrahimkoz1983 2 ай бұрын
@codingwithjamal nope. Postgres stores json as jsonb and it is blazingly fast.
@interviewpen
@interviewpen 2 ай бұрын
From my understanding, postgres doesn’t have the same ability to select or filter on json fields. But regardless, using a solution that was designed from the ground up for this use case will generally result in a better experience. Thanks for the insight!
@sharmanihal
@sharmanihal 2 ай бұрын
@@interviewpen Postgres can quite nicely filter/search/index the json fields; however, this only does not make it an ideal candidate to choose over MongoDB.
@ehm-wg8pd
@ehm-wg8pd 2 ай бұрын
this is gold
@interviewpen
@interviewpen 2 ай бұрын
Thanks for watching!
@saiyijinprince
@saiyijinprince 2 ай бұрын
I think you missed a huge aspect about when you to choose between SQL vs NoSQL. At the end of the day, its more about picking the right tool for the job, and less about the scale of the data. If you need ACID transactions, use SQL. If you're okay with eventual consistency then NoSQL might be easier. The scale of your data is just one minor aspect you need to consider when building a system. I'd argue you can scale both types of DBs just as much as each other but it'll all come down to what kind of trade offs you're willing to make. Its not uncommon to have a combination of both NoSQL and SQL DBs, they are not mutually exclusive.
@v.demchenko
@v.demchenko 23 күн бұрын
Is it possible to just explain it in really simple way? After 6 minutes I still doesn't understand about what are you talking about. For the what reason you give this examples for SQL scaling problems for the whole video??? Redicilous...
@interviewpen
@interviewpen 14 күн бұрын
Sorry to hear it was confusing, but I don't understand your question. Could you clarify what you're confused about?
HTTP/1.1 vs HTTP/2 vs HTTP/3 | System Design
6:26
Interview Pen
Рет қаралды 6 М.
Design a Data Warehouse | System Design
14:08
Interview Pen
Рет қаралды 33 М.
The Best Band 😅 #toshleh #viralshort
00:11
Toshleh
Рет қаралды 22 МЛН
Which Database Model to Choose?
24:38
High-Performance Programming
Рет қаралды 70 М.
Cassandra Database Crash Course
19:48
Code with Irtiza
Рет қаралды 36 М.
Design a Simple Authentication System | System Design Interview Prep
17:22
Systems Design in an Hour
1:11:00
Jordan has no life
Рет қаралды 41 М.
Why Does Diffusion Work Better than Auto-Regression?
20:18
Algorithmic Simplicity
Рет қаралды 436 М.
Database Indexing for Dumb Developers
15:59
Laith Academy
Рет қаралды 86 М.
Introduction to NoSQL databases
26:18
Gaurav Sen
Рет қаралды 794 М.
Basic System Design for Uber or Lyft | System Design Interview Prep
16:18