reading-notes

My reading notes journal for Code Fellows

View the Project on GitHub

*Readings: MongoDB and Mongoose

nosql vs sql

  1. Five differences between SQL and NoSQL databases:

SQL

  1. SQL databases are primarily called as Relational Databases (RDBMS).
  2. SQL databases are table based databases. SQL databases represent data in form of tables which consists of n number of rows of data
  3. SQL databases have predefined schema.
  4. SQL databases are vertically scalable. SQL databases are scaled by increasing the horse-power of the hardware.
  5. SQL databases uses SQL ( structured query language ) for defining and manipulating the data, which is very powerful.

NoSQL

  1. NoSQL database are primarily called as non-relational or distributed database.
  2. NoSQL databases are document based, key-value pairs, graph databases or wide-column stores. NoSQL databases are the collection of key-value pair, documents, graph databases or wide-column stores which do not have standard schema definitions which it needs to adhered to
  3. NoSQL databases have dynamic schema for unstructured data.
  4. NoSQL databases are horizontally scalable. NoSQL databases are scaled by increasing the databases servers in the pool of resources to reduce the load.
  5. NoSQL database, queries are focused on collection of documents.

  6. What kind of data is a good fit for an SQL database? Complex query intensive environment.
  7. Give a real world example. MySQL Community Edition.
  8. What kind of data is a good fit a NoSQL database? Large dataset (Big Data). Hierarchical data storage as it follows the key-value pair way of storing data similar to JSON data.
  9. Give a real world example. MongoDB.
  10. Which type of database is best for hierarchical data storage? NoSQL.
  11. Which type of database is best for scalability? SQL Databases.

sql vs nosql

  1. What does SQL stand for? Structured Query Language.
  2. What is a relational database? When you have a database that works with certain assumptions and supports SQL.
  3. What type of structure does a relational database work with? Tables for example a table where you store products for your app.
  4. What is a ‘schema’? It determines which data can go into a table. It is defined by “fields” or columns. In these fields we have id, name, price, description as an example.
  5. What is a NoSQL database? Its build to store lots of data in an efficient way.
  6. How does it work? Uses collections inside of its database and inside those collections are documents.
  7. What is inside of a MongoDB database? Database (shop), collections(similar to table in a way), documents that don’t require the same schema (look similar to json).
  8. Which is more flexible - SQL or MongoDB? and why. Never one it all depends on the situation but i’m going with MongoDB because there is no schema’s and generally no relations. No SQL has fast query and less relation merging. If you have a lot of reads and not many writes this works well.
  9. What is the disadvantage of a NoSQL database? You can end up with duplicate data, if for example a product name changes you would then have to update it in both the products collections and the orders collection.

References

https://www.thegeekstuff.com/2014/01/sql-vs-nosql-db/?utm_source=tuicool https://www.youtube.com/watch?v=ZS_kXvOeQ5Y