reading-notes

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
  1. data that is a good fit for sql is stuff like user ID’s and their passwords since they are closely related
  2. usernames and passwords
  3. a good fit for nosql is any data that needs to be added onto after the fact
  4. ex: product orders
  5. nosql is best for scalability

Video: Sql vs NoSql

sql vs nosql

  1. SQL stands for structured query language
  2. a relational db is one that has multiple tables that are related to each other
  3. dql uses tables to define where data goes
  4. a schema defines what can go where
  5. nosql is made to hold large amounts of data unlike sql
  6. it has collections of documents and no schema or relations
  7. inside of mongodb is collections and documents inside those collections
  8. mongodb is more flexible because it can store more and is not as strictly structured as sql
  9. the disadvantage of nosql is that if you need to update exsisting data it is hard to do on nosql