Skip to content

Instantly share code, notes, and snippets.

@MenarSelamet
Last active July 2, 2024 08:44
Show Gist options
  • Save MenarSelamet/6b7f60f314ea640f705ab32de1583a4a to your computer and use it in GitHub Desktop.
Save MenarSelamet/6b7f60f314ea640f705ab32de1583a4a to your computer and use it in GitHub Desktop.
SQL vs NoSQL

SQL vs NoSQL Discussion Questions:

  1. What is the main difference between SQL and NoSQL databases?
  2. How does the structure of data in SQL databases differ from that in NoSQL databases?
  3. Which type of database is typically better for handling large volumes of data: SQL or NoSQL and why?
  4. What is a common use case for SQL databases?
  5. What is a common use case for NoSQL databases?
  6. What is a key feature of MongoDB that makes it different from traditional SQL databases?
  7. Why might a developer choose MongoDB for a project?
  8. What type of data format does MongoDB use to store information?
@NonhlanhlaMazibuko
Copy link

NonhlanhlaMazibuko commented Jul 2, 2024

Team members:

  • Thitevhelwi Masuvhe
  • Nonhlanhla Mazibuko
  • Pumlani Kewana
  1. SQL is a structured query language used for relational databases and NoSQL is a database management system that does not use SQL to query non-relational databases.

  2. SQL databases are table-based, while NoSQL databases are document, key-value, graph, or wide-column stores. SQL databases are better for multi-row transactions, while NoSQL is better for unstructured data like documents or JSON.

  3. NoSQL databases are typically better suited for handling large volumes of data due to the following reasons:

  • Horizontally scalability:
    NoSQL databases are designed to scale horizontally, meaning they can easily distribute data across multiple servers.

  • Flexible Schema:
    NoSQL databases have flexible schemas, meaning they can store different types of data structures and accommodate changes in data forms without requiring significant changes to the database structure.

  • High Performance for Specific Use Cases:
    No SQL databases are optimized for specific use cases, such as key-value stores, document stores, or graph databases.

  1. SQL used for querying and manipulating the data by organizations in multiple enterprise applications such as to track inventories, manage vast amounts of customers’ sensitive information, and process e-commerce transactions.

  2. NoSQL common use cases

  • Big data: can be used to process and analyze large datasets such as data generated from as social networks and IoT data. For example, NoSQL can be used in social networks such as Facebook, Twitter, and LinkedIn to store and retrieve user profiles, posts, comments, and connections because they can handle the complex, interconnected data structures of social networks and provide quick access to user-generated content. NoSQL databases can be used to collect and analyze data from various IoT devices because they can handle the high volume and variety of the data generated.
  1. The key feature that separate MongoDB from traditional SQL databases is its document-oriented data model. MongoDB, data is stored in felexible, JSON-like documents called BSON (Binary JSON). Each document can have a different structure, allowing for schema flexibility.

In contrast, traditional SQL databases use a grid table-based model. All rows in a table must have the same columns, enforcing a fixed schema.

The difference in data models has several implications. Flexibility, The MongoDB document model is more adaptable. to changing data requirements and unstructured data. Easy of Use: The MongoDB document model often aligns more naturally with the way developers think about and structure applications. Performance, for certain types of queries and workloads, the MongoDB document model can lead to faster performance than the SQL relational model.

  1. Its flexible schema makes it easy to evolve and store data in a way that is easy for programmers to work with. It enables them to build applications faster, handle highly diverse data types, and manage applications more efficiently at scale.

  2. BSON, or Binary JSON, is the data format that MongoDB uses to organize and store data. This data format includes all JSON data structure types and adds support for types including dates, different size integers, ObjectIds, and binary data.

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