lecture 8
32 Questions
4 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What is a key characteristic of a columnar database?

  • It supports a fixed schema for all rows.
  • Data can be stored in a flexible schema. (correct)
  • Data is stored in rows only.
  • It always requires indexing for speed.
  • In a graph database, what does a node represent?

  • A data type constraint.
  • A relationship to another node.
  • An entity that can contain properties. (correct)
  • A data record from a table.
  • Which of the following databases is NOT an example of a columnar database?

  • MySQL (correct)
  • Amazon SimpleDB
  • HBase
  • Cassandra
  • What aspect of NoSQL databases might encourage their usage?

    <p>Need for high data availability.</p> Signup and view all the answers

    What is one of the primary benefits of using a relational database?

    <p>Consistency</p> Signup and view all the answers

    Which of the following best describes a key-value database?

    <p>Uses a simple hash table for data storage</p> Signup and view all the answers

    What is typically used to describe the connection between two nodes in a graph database?

    <p>Relationships</p> Signup and view all the answers

    How does Redis primarily differ from traditional disk-based databases?

    <p>It performs in-memory operations</p> Signup and view all the answers

    Why might columnar databases be less optimal for insert operations?

    <p>Performance metrics for writes are typically lower.</p> Signup and view all the answers

    Which statement best describes the nature of NoSQL databases?

    <p>They simplify data models for better generalizability</p> Signup and view all the answers

    How does data compression benefit a columnar database?

    <p>Optimizes storage efficiency.</p> Signup and view all the answers

    What is a significant advantage of using Redis as a key-value database?

    <p>Multiple data structures for efficiency</p> Signup and view all the answers

    Which of the following terms is commonly associated with graph algorithms?

    <p>Traversal</p> Signup and view all the answers

    What feature does a document database offer compared to a relational database?

    <p>Storage of heterogeneous metadata</p> Signup and view all the answers

    Which operation is NOT typically associated with a key-value store like Redis?

    <p>Performing complex queries with joins</p> Signup and view all the answers

    What primary challenge does a traditional relational database face in big data environments?

    <p>Scalability and partitioning</p> Signup and view all the answers

    Which statement accurately describes the indexing method used in MongoDB?

    <p>Indexes in MongoDB can contain multiple keys for optimization.</p> Signup and view all the answers

    What is a significant limitation of MongoDB regarding transactions?

    <p>MongoDB is not suitable for heavy and complex transaction systems.</p> Signup and view all the answers

    In MongoDB, which of the following is the correct method to delete a specific document matching a criterion?

    <p>db.collection_name.remove()</p> Signup and view all the answers

    How does MongoDB handle data partitioning?

    <p>Data is distributed through automated range-based partitioning.</p> Signup and view all the answers

    What is the default behavior when inserting a document in MongoDB if the '_id' field is omitted?

    <p>MongoDB generates a unique key for the document.</p> Signup and view all the answers

    Which of the following best describes the data structure used in MongoDB as opposed to traditional relational databases?

    <p>MongoDB organizes data into collections and documents instead of rows and columns.</p> Signup and view all the answers

    What is the purpose of the '_id' field in MongoDB?

    <p>It serves as a primary key for document identification.</p> Signup and view all the answers

    Which of the following operations can be performed through the MongoDB API?

    <p>Performing atomic updates and consistent reads.</p> Signup and view all the answers

    What type of database is characterized by no relation schema and is often used to store data in JSON, BSON, or XML documents?

    <p>Document Database</p> Signup and view all the answers

    Which of the following represents a potential reason not to migrate from SQL to NoSQL?

    <p>Existing SQL structure is sufficient</p> Signup and view all the answers

    In the context of SQL to NoSQL migration, which scheme is the most popular?

    <p>1-1 mapping scheme</p> Signup and view all the answers

    When is it advisable to design a NoSQL solution from the beginning rather than migrating from SQL?

    <p>When dramatic application changes are required</p> Signup and view all the answers

    What is a disadvantage of using SQL databases compared to NoSQL databases during data assembly?

    <p>More data assembling and disassembling required</p> Signup and view all the answers

    Which item is NOT commonly associated with a document database?

    <p>Use of relational tables</p> Signup and view all the answers

    Which of the following is a potential benefit of using a document database?

    <p>Reduced need for translation</p> Signup and view all the answers

    What describes the data structure format used in document databases?

    <p>Flexible and schema-less</p> Signup and view all the answers

    Study Notes

    INF2003: Database Systems NoSQL AY24/25 Trimester 1

    • Course offered by Singapore Institute of Technology (SIT)
    • Presented by Zhang Wei on November 5, 2024

    Relational DB: Advantages and Gap

    • Benefits:
      • Consistency, concurrency, recovery
      • Matematical background, solid and rigorous
      • SQL for management and communication
      • Mature ecosystem with tools and services
      • Fact: MySQL database is centralized, stored on a single disk.
    • Good points:
      • Fast local joins, easy management
    • Bad points:
      • Scalability/partitioning issues
      • Robustness/replication problems
      • Task dispatching challenges
    • Reality:
      • Big data handling, Geo-distribution, and data diversity

    NoSQL

    • Goal: Simplify data models for wider use cases.
    • Features:
      • Diverse data types and locations
    • Types:
      • Key-value: Simplest NoSQL, a hash table with key-value pairs. Example: Redis.
    • Store, retrieve values in O(1) time
    • Support for data structures (Strings, hashes, lists, sets etc)
    • In-memory operations for speed
    • Data persistency to disk for reliability
    • Many languages supported (Python, Java, C#, C++, etc.)
      • Document:
    • Handles heterogeneous metadata
    • Suitable for storing items (e.g., Lazada/Shopee products) - Not suitable for relational database
      • Columnar:
    • Data stored in columns, not rows
    • Flexible schema design
    • Data compression
    • Examples: HBase, Cassandra, Hypertable, Amazon SimpleDB, etc.
      • Graph:
    • Explicit graph structure
    • Each node knows its adjacent nodes
    • Suitable for applications with native graph structure (social networking)
    • Easily applies graph algorithms
    • Node: Contains properties
    • Relationship: Connects two nodes (e.g., acted_in)
    • Property: Named values (e.g., 'name', 'Tom Hanks')
    • Label: Type of node (e.g., person)

    MongoDB

    • Founded in 2007
    • Document-oriented NoSQL database
    • Written in C++
    • Hash-based schema-less database
    • Uses strings for keys
    • Document identifiers are automatically generated
    • Supports various programming languages (Javascript, Python)
    • Features: secondary indexes, atomic writes, master-slave replication, automatic failover, horizontal scaling
    • No joins (using scripts)

    SQL -> NoSQL Migration

    • Possible reasons: Business scale-up, application changes
    • Scheme 1 (1:1 mapping): Most popular, translate SQL table to NoSQL collections
      • Tools like AWS DMS, Python libraries available
      • Sample code readily available
    • Scheme 2 (Denormalization): Decompose to bigger structures
    • Scheme 3 (Forget migration): Start from scratch with a new design (better for major app changes)

    Columnar Databases

    • Database as key-value pairs
    • Key is comprised of 3 parts: row key, column key & timestamp
    • Data stored column-wise
    • Flexible schema
    • Data compression
    • Examples: HBase, Cassandra, Hypertable

    Studying That Suits You

    Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

    Quiz Team

    Description

    nosql

    More Like This

    Data Management and NoSQL Systems Quiz
    99 questions
    NoSQL Database Introduction Quiz
    21 questions
    Types of Databases Overview
    12 questions
    Database Types Overview
    13 questions

    Database Types Overview

    SelfSufficiencySandDune avatar
    SelfSufficiencySandDune
    Use Quizgecko on...
    Browser
    Browser