reading-notes

Class 11 MongoDB and Mongoose

Link to article: sql vs nosql

Link to article: sql vs nosql video


SQL vs NoSQL

Fill in the chart below with five differences between SQL and NoSQL databases:

SQL

SQL databases store data in fixed schemas within tables.

SQL databases excel at complex queries and transactions, ideal for finance.

SQL databases ensure data is consistently up-to-date and accurate.

SQL databases use SQL for querying and manipulating data.

SQL databases have a long history and established best practices.

NoSQL

NoSQL databases are non-relational databases, meaning that they don’t rely on a fixed schema and data can be stored in a variety of formats, such as key-value pairs, documents, or graphs.

NoSQL databases are better suited for applications that require scalability and performance, such as big data and real-time web applications.

NoSQL databases prioritize speed over consistency, potentially causing data inconsistencies.

NoSQL databases use a variety of query languages, depending on the database type, such as MongoDB’s query language or Cassandra’s CQL (Cassandra Query Language).

NoSQL databases are a relatively new technology, and while they have gained popularity in recent years, there is still a lack of industry standards and best practices. What kind of data is a good fit for an SQL database?

What kind of data is a good fit for an SQL database?

Data that requires complex queries, transactions, and strong consistency, such as financial or accounting data, is a good fit for an SQL database.

Give a real world example.

A bank’s customer account information, which requires precise and accurate data management, would be well-suited for an SQL database.

What kind of data is a good fit a NoSQL database?

Data that requires high scalability, flexibility, and fast performance, such as social media or e-commerce applications, is a good fit for a NoSQL database.

Give a real world example.

An e-commerce website that handles millions of product listings and user data would benefit from a NoSQL database like MongoDB to achieve high scalability and performance.

Which type of database is best for hierarchical data storage?

A document-oriented NoSQL database like MongoDB is best for hierarchical data storage where data is organized in a tree-like structure.

Which type of database is best for scalability??

NoSQL databases, such as Cassandra or MongoDB, are best for scalability due to their ability to handle large amounts of data and traffic with high performanc


SQL vs NoSQL Video

What does SQL stand for?

Structured Query Language.

What is a relational database?

A relational database is a type of database that organizes data into tables with defined relationships between them.

What type of structure does a relational database work with?

A relational database works with a structured data model where data is organized into tables with defined columns and rows.

What is a ‘schema’?

A schema defines the structure and organization of a relational database, including tables, relationships, and data constraints.

What is a NoSQL database?

A NoSQL database is a type of database that does not use a structured table-based schema, and is designed to handle large and diverse data sets with flexible data models.

How does it work?

NoSQL databases use flexible data models and distributed architectures to achieve high scalability and fault tolerance.

What is inside of a MongoDB database?

MongoDB databases contain collections of flexible BSON-format documents.

Which is more flexible - SQL or MongoDB? and why.

MongoDB is more flexible than SQL due to its dynamic schema, which allows for easier adaptation to changing data structures.

What is the disadvantage of a NoSQL database?

NoSQL databases may lack data consistency and transactional integrity compared to traditional relational databases in distributed environments with high write volumes.