WorksheetsUnderstanding NoSQL Databases
Total questions: 20
Worksheet time: 10mins
What is scalability in NoSQL databases?
Scalability in NoSQL databases is about maintaining a fixed amount of data.
Scalability in NoSQL databases is the capability to expand resources to accommodate growth in data and traffic efficiently.
Scalability refers to the ability to reduce resources during low traffic.
Scalability means the database can only handle a single user at a time.
How do NoSQL databases achieve horizontal scalability?
By storing all data in a single server for better performance.
By using a fixed number of servers to manage data load.
NoSQL databases achieve horizontal scalability by distributing data across multiple servers, allowing for increased load handling by adding more machines.
By compressing data to reduce storage requirements.
What is the CAP theorem in the context of NoSQL?
The CAP theorem applies only to SQL databases, not NoSQL.
A distributed data store can guarantee all three properties: Consistency, Availability, and Partition Tolerance.
The CAP theorem states that a distributed data store can only guarantee two out of the three properties: Consistency, Availability, and Partition Tolerance.
Partition Tolerance is not a requirement for distributed systems.
Explain the trade-off between consistency and availability.
Prioritizing availability means data is always accurate.
The trade-off between consistency and availability is that prioritizing one often leads to sacrificing the other in distributed systems.
Consistency and availability are always achieved simultaneously.
Consistency is irrelevant in distributed systems.
What are the main types of NoSQL databases?
Document Stores, Key-Value Stores, Column Family Stores, Graph Databases
Object-Oriented Databases
Flat File Systems
Relational Databases
Define a document store and give an example.
Cassandra
Redis
Elasticsearch
MongoDB
What is a key-value store?
A key-value store is a type of relational database.
A key-value store is a programming language.
A key-value store is a file storage system.
A key-value store is a NoSQL database that stores data as a collection of key-value pairs.
How does a column-family store differ from a relational database?
A column-family store uses SQL for queries and has a fixed schema.
A column-family store is optimized for complex queries and has a fixed schema.
A column-family store allows flexible schemas and is optimized for large datasets, while a relational database has a fixed schema and is designed for complex queries.
Relational databases are designed for large datasets and allow flexible schemas.
What is a graph database and when would you use it?
A graph database is a flat file system for unstructured data.
A graph database is a database that uses graph structures to represent and store data, ideal for handling complex relationships.
Graph databases are only used for storing images and videos.
A graph database is a type of relational database for structured data.
What is eventual consistency in NoSQL systems?
Eventual consistency is only applicable to SQL databases.
Eventual consistency means data is always consistent at all times.
Eventual consistency ensures immediate updates across all nodes.
Eventual consistency means that, in a NoSQL system, all updates will eventually be reflected across all nodes, but immediate consistency is not guaranteed.
How do NoSQL databases handle large volumes of data?
NoSQL databases manage large volumes of data through horizontal scaling, flexible data models, sharding, and replication.
NoSQL databases do not support data replication.
NoSQL databases require a fixed schema for data storage.
NoSQL databases only use vertical scaling to manage data.
What is the role of sharding in NoSQL databases?
Sharding reduces the amount of data stored in a single server.
Sharding is used to encrypt data for security purposes.
Sharding improves performance and scalability by distributing data across multiple servers.
Sharding consolidates data into a single database for easier management.
Explain the concept of schema flexibility in NoSQL.
Schema flexibility in NoSQL requires a predefined structure.
Schema flexibility in NoSQL limits data types to a fixed format.
Schema flexibility in NoSQL enforces strict data validation rules.
Schema flexibility in NoSQL allows for dynamic and varied data structures without a fixed schema.
What are some common use cases for NoSQL databases?
Common use cases for NoSQL databases include big data applications, real-time web applications, content management systems, and IoT data storage.
Relational database management
Static file hosting
Data warehousing solutions
How do NoSQL databases ensure data replication?
NoSQL databases do not support data replication.
Data replication in NoSQL is achieved through manual backups only.
NoSQL databases use replication mechanisms like master-slave and peer-to-peer to ensure data is copied across multiple nodes.
NoSQL databases rely solely on cloud storage for data replication.
What is the difference between strong consistency and eventual consistency?
Eventual consistency guarantees immediate consistency across all nodes.
Strong consistency allows for temporary inconsistencies that will resolve over time.
Strong consistency is less reliable than eventual consistency.
Strong consistency guarantees immediate consistency across all nodes, while eventual consistency allows for temporary inconsistencies that will resolve over time.
What are some advantages of using NoSQL over traditional SQL databases?
Better support for complex transactions
Increased data integrity
Faster query performance for structured data
Advantages of NoSQL over SQL include flexibility in data models, horizontal scalability, lower latency, and support for various data types.
How do NoSQL databases manage distributed data?
NoSQL databases use SQL queries for data management.
NoSQL databases store all data in a single location.
NoSQL databases manage distributed data through sharding, replication, and eventual consistency.
NoSQL databases require strict ACID compliance for transactions.
What is a multi-model database?
A multi-model database is a database that supports multiple data models within a single system.
A multi-model database is exclusively for unstructured data.
A multi-model database only supports one data model at a time.
A multi-model database is a type of relational database.
What are some challenges associated with NoSQL databases?
Automatic data consistency across all nodes
Simple querying with SQL-like syntax
High scalability with no limitations
Challenges associated with NoSQL databases include data consistency, complex querying, limited transaction support, and varying data models.
