NoSQL Fundamentals Flashcards
What is NoSQL? Differences between SQL and NoSQL CAP theorem (Consistency, Availability, Partition Tolerance) BASE vs ACID Horizontal scaling and sharding basics Four main types of NoSQL databases: Document, Key-Value, Columnar, Graph Use cases where NoSQL is preferred (22 cards)
What is NoSQL?
NoSQL stands for ‘Not Only SQL’ and refers to a broad class of database systems that are non-relational and typically designed for horizontal scalability and flexible data models.
What are the differences between SQL and NoSQL?
SQL databases use structured schema and tables, while NoSQL databases support various data models (document, key-value, graph, columnar) and offer flexible schemas for scalability and performance.
What is the CAP theorem in NoSQL databases?
The CAP theorem states that in a distributed system, you can only guarantee two out of three: Consistency, Availability, and Partition Tolerance.
What is BASE in contrast to ACID?
BASE (Basically Available, Soft state, Eventually consistent) is often used in NoSQL systems, focusing on availability and performance, whereas ACID focuses on strict consistency and reliability.
What is horizontal scaling in NoSQL databases?
Horizontal scaling refers to adding more servers to handle increased load, which NoSQL databases support more easily than traditional SQL systems.
What is sharding in NoSQL databases?
Sharding is the process of splitting a large database into smaller, faster, more easily managed pieces called shards, often based on a shard key.
What are the four main types of NoSQL databases?
Document databases, Key-Value stores, Column-family stores, and Graph databases are the four primary types of NoSQL systems.
When is NoSQL preferred over SQL?
NoSQL is ideal when dealing with large-scale, unstructured, or semi-structured data, requiring high availability, flexible schema, or distributed architecture.
What are examples of document-oriented NoSQL databases?
MongoDB and CouchDB are examples of document databases that store data as JSON-like documents.
What are examples of key-value NoSQL databases?
Redis and DynamoDB are key-value stores that provide high-speed lookups using a simple key-based access pattern.
What are examples of columnar NoSQL databases?
Apache Cassandra and HBase are column-family stores optimized for high write throughput and time-series data.
What are examples of graph NoSQL databases?
Neo4j and Amazon Neptune are graph databases used for handling complex relationships, such as in social networks or recommendation engines.
What is an architectural implication of using NoSQL?
NoSQL allows for distributed, highly scalable architectures, often leading to increased system complexity for consistency and query logic.
What are advantages of NoSQL databases?
NoSQL offers flexibility, horizontal scalability, and high performance for large datasets with minimal upfront schema design.
What are disadvantages of NoSQL databases?
Lack of standardized query language, eventual consistency issues, and complexity in enforcing relationships and data integrity.
What are best practices when using NoSQL?
Choose the appropriate NoSQL type for the use case, use proper indexing, handle schema changes cautiously, and understand the tradeoffs with consistency.
What is the impact of NoSQL on system design?
NoSQL enables more scalable and flexible system design, especially for cloud-native and distributed architectures handling massive, diverse data.
How does NoSQL improve performance and fault tolerance?
NoSQL improves performance through caching and reduced disk I/O, and provides fault tolerance via replication and eventual consistency across nodes.
How is monitoring and debugging different in NoSQL systems?
Monitoring NoSQL involves tracking replication lag, query latency, and node health. Debugging may be harder due to denormalized and flexible data.
What are common real-world tradeoffs with NoSQL?
You often trade strong consistency and schema validation for flexibility and performance in distributed systems.
What is a common interview question about NoSQL?
Explain when you would choose NoSQL over SQL and which NoSQL database type you’d use for different scenarios.
What is a potential gotcha with NoSQL systems?
Assuming eventual consistency means immediate consistency or failing to plan for data modeling complexities in denormalized formats.