MongoDB and Mongoose
Nosql vs Sql
Differences between sql and nosql databases
-
- SQL is relational and nosql is non-relational or distributed
- SQL is table based while nosql is document based
- sql is pre-defined while nosql is not
- sql scales vertically while nosql scales horizontally
- data that is a good fit for sql is stuff like user ID’s and their passwords since they are closely related
- usernames and passwords
- a good fit for nosql is any data that needs to be added onto after the fact
- ex: product orders
- nosql is best for scalability
Video: Sql vs NoSql
sql vs nosql
- SQL stands for structured query language
- a relational db is one that has multiple tables that are related to each other
- dql uses tables to define where data goes
- a schema defines what can go where
- nosql is made to hold large amounts of data unlike sql
- it has collections of documents and no schema or relations
- inside of mongodb is collections and documents inside those collections
- mongodb is more flexible because it can store more and is not as strictly structured as sql
- the disadvantage of nosql is that if you need to update exsisting data it is hard to do on nosql