Skip to content

Instantly share code, notes, and snippets.

@Kishimoto96
Created April 27, 2023 14:36
Show Gist options
  • Select an option

  • Save Kishimoto96/1dcb8bddee9f84b77c7ef4d1bb5cd2fa to your computer and use it in GitHub Desktop.

Select an option

Save Kishimoto96/1dcb8bddee9f84b77c7ef4d1bb5cd2fa to your computer and use it in GitHub Desktop.

Discussion about SQL and NoSQL:

  1. What is NoSQL?
  2. What is the difference between SQL and NoSQL databases, and when should you use one over the other?
  3. How do the data structures of SQL and NoSQL databases differ?
  4. What is MongoDB? and why we call it a document-oriented database?
  5. What are the most important MongoDB commands? explain two of them.
@motaz99
Copy link

motaz99 commented Apr 27, 2023

Rasam, Asli, Baraah, Motaz

  1. NoSQL databases are non-relational databases. They have roughly the same characteristics as SQL databases (durable, resilient, persistent, replicated, distributed, and performant) except for the major difference of not enforcing schemas (or enforcing only very loose schemas). These databases provide flexible schemas and scale easily with large amounts of data and high user loads.

  2. SQL uses tables and creates relations between data, NoSQL uses documents and most probably doesn't have relations between data. NoSQL databases is better with the huge applications because it is more flexible and cheap for add new features, it are also good with frequent data changes, SQL is slower but still reliable on huge apps, it has fixed data, it is expensive to grow up.

  3. In SQL they use tables to store data and they create relations between tables, NoSQL databases (aka "not only SQL") are non-tabular databases and store data differently than relational tables. NoSQL databases come in a variety of types based on their data model. The main types are document, key-value, wide-column, and graph.

  4. MongoDB is a popular open-source NoSQL database that is designed to store and manage unstructured and semi-structured data. It is a document-oriented database that stores data in flexible and scalable JSON-like documents, which are known as BSON (Binary JSON) documents. MongoDB a document-oriented database because it focuses on storing and managing data as self-contained documents instead of using traditional relational database tables with rows and columns

    1. db.collection.insertOne(): This command is used to insert a single document into a collection in MongoDB
    2. db.collection.find(): This command is used to retrieve documents from a collection in MongoDB. It can be used to find all
      documents in a collection or to find documents that match a specific condition

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment