trilogy-group / tu2k22-zhiyuangao

0 stars 0 forks source link

zhiyuangao_nosql_intro #25

Closed gao-ti closed 2 years ago

gao-ti commented 2 years ago

1. Explanation of the use case

Scalability issues. SQL scales vertically, but NoSQL scales horitzontally.

2. Why SQL is not suitable

SQL needs vertical scaling -- more cpu, more memory to one single db instance. Usually, autoscaling means horizontal scaling, but recently AWS supports vertical scaling as well.

This can be capped due to

  1. cost reasons: it's difficult to afford very power cpu at some point. Also, DB does not need all those resources to be present all the time.
  2. ssd access bandwidth: for one instance, we can add more cpu and memory, but the bandwidth to ssd (in terms of aws then gp2) will be the bottleneck at some point -- we cannot scale SQL vertically without limits.

3. How NoSQL solves the problem

NoSQL scales horizontally, meaning we can have many DB instances running in parallel.

4. Tradeoffs

gao-ti commented 2 years ago

1. Explanation of the use case

No predefine schema, unstructured, varied data structures e.g., key value pairs

2. Why SQL is not suitable & How NoSQL solves the problem

It is good for start-ups where flexibility is preferred. They change things often and need changes fast image

4. Tradeoffs

There is no schema in nosql. It can be difficult to migrate or replicate_

gao-ti commented 2 years ago

1. Explanation of the use case

Working with unstructured data

2. Why SQL is not suitable

SQL does not allow unstructured data such as key-value pair, graphs, documents

3. How NoSQL solves the problem

NoSQL databases generally provide flexible schemas that enable faster and more iterative development. The flexible data model makes NoSQL databases ideal for semi-structured and unstructured data There are many options on the cloud https://aws.amazon.com/nosql/

4. Tradeoffs

Queries are slower in nosql

gao-ti commented 2 years ago

1. Explanation of the use case

Very large data -- hard to keep in one place as in SQL

2. Why SQL is not suitable

SQL DB basically require data to be stored in one instance It is not feasible when the data is very large

3. How NoSQL solves the problem

NoSQL stores data across multiple processing nodes, as well as across multiple servers

4. Tradeoffs

The ability to store in one instance makes queries faster, replicating easier/faster, and DB dump/restore as well.

gao-ti commented 2 years ago

1. Explanation of the use case

Many join operations. No need for highly efficient queries

2. Why SQL is not suitable

Join operations are basically slow in mysql.

3. How NoSQL solves the problem

There's no join in nosql

4. Tradeoffs

We can't migrate the entire company database to nosql, it's not realistic. Also, nosql queries are slower