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)

1
Q

What is NoSQL?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the differences between SQL and NoSQL?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the CAP theorem in NoSQL databases?

A

The CAP theorem states that in a distributed system, you can only guarantee two out of three: Consistency, Availability, and Partition Tolerance.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is BASE in contrast to ACID?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is horizontal scaling in NoSQL databases?

A

Horizontal scaling refers to adding more servers to handle increased load, which NoSQL databases support more easily than traditional SQL systems.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is sharding in NoSQL databases?

A

Sharding is the process of splitting a large database into smaller, faster, more easily managed pieces called shards, often based on a shard key.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the four main types of NoSQL databases?

A

Document databases, Key-Value stores, Column-family stores, and Graph databases are the four primary types of NoSQL systems.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

When is NoSQL preferred over SQL?

A

NoSQL is ideal when dealing with large-scale, unstructured, or semi-structured data, requiring high availability, flexible schema, or distributed architecture.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are examples of document-oriented NoSQL databases?

A

MongoDB and CouchDB are examples of document databases that store data as JSON-like documents.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are examples of key-value NoSQL databases?

A

Redis and DynamoDB are key-value stores that provide high-speed lookups using a simple key-based access pattern.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are examples of columnar NoSQL databases?

A

Apache Cassandra and HBase are column-family stores optimized for high write throughput and time-series data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are examples of graph NoSQL databases?

A

Neo4j and Amazon Neptune are graph databases used for handling complex relationships, such as in social networks or recommendation engines.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is an architectural implication of using NoSQL?

A

NoSQL allows for distributed, highly scalable architectures, often leading to increased system complexity for consistency and query logic.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are advantages of NoSQL databases?

A

NoSQL offers flexibility, horizontal scalability, and high performance for large datasets with minimal upfront schema design.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are disadvantages of NoSQL databases?

A

Lack of standardized query language, eventual consistency issues, and complexity in enforcing relationships and data integrity.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are best practices when using NoSQL?

A

Choose the appropriate NoSQL type for the use case, use proper indexing, handle schema changes cautiously, and understand the tradeoffs with consistency.

17
Q

What is the impact of NoSQL on system design?

A

NoSQL enables more scalable and flexible system design, especially for cloud-native and distributed architectures handling massive, diverse data.

18
Q

How does NoSQL improve performance and fault tolerance?

A

NoSQL improves performance through caching and reduced disk I/O, and provides fault tolerance via replication and eventual consistency across nodes.

19
Q

How is monitoring and debugging different in NoSQL systems?

A

Monitoring NoSQL involves tracking replication lag, query latency, and node health. Debugging may be harder due to denormalized and flexible data.

20
Q

What are common real-world tradeoffs with NoSQL?

A

You often trade strong consistency and schema validation for flexibility and performance in distributed systems.

21
Q

What is a common interview question about NoSQL?

A

Explain when you would choose NoSQL over SQL and which NoSQL database type you’d use for different scenarios.

22
Q

What is a potential gotcha with NoSQL systems?

A

Assuming eventual consistency means immediate consistency or failing to plan for data modeling complexities in denormalized formats.