- What is the difference between SQL and NoSQL?
- What is referencing and what is embedding in MongoDB?
- Why should we embed more than referencing when we can in MongoDB?
- When should we prefer referencing over nesting in MongoDB?
- What are ORMs? Why we use them? Give an example of an SQL request with and without using ORM.
- What is the difference between a table and a collection?
Some helpful resources:
team 6 Hassan AbuGareeb, Lunar Salameh, Sanad AlShobaki, Hadeel Obaid
1- SQL: (Structured Query Language) vs NOSQL(NOT only SQL) SQL databases are best used for structured data, NoSQL databases are suitable for structured, semi-structured, and unstructured data
-SQL databases are relational, and NoSQL databases are non-relational.
-noSql syntax is more flexible.
-SQL databases are vertically scalable, while NoSQL databases are horizontally scalable.
-sql is table based, noSQL have 4 types (document, wide-column, graph,key-value).
2- Referencing involves storing references to related documents within a document,
Embedding involves nesting one document inside another.
3- to reduce dependency between collections, and localize data retrieval, reduce redundancy, increase query performance, increase simplicity and readability.
4- when there's Many-to-Many Relationships, Frequent Updates to Related Data, and when the amount of data and keys is large, referencing is preferred to reduce complexity.
5- ORM (Object–relational mapping): ORM provides a way to map between the objects in your code and the tables in a relational database, we use them to simplify syntax and makes interacting with databases in code easier,
EX:
no orm:
SELECT * FROM users WHERE username LIKE 'john%';
orm:
User.username.like('john%')
6- Table: The term "table" is typically associated with relational databases. In a relational database management system (RDBMS), data is organized into tables, each of which has a predefined schema with columns and data types.
Collection: The term "collection" is commonly used in the context of NoSQL databases, especially document-oriented databases like MongoDB. In MongoDB, data is stored in collections, and each document within a collection can have a different structure.