SQL vs NoSql Flashcards

1
Q

What are the primary types of NoSQL dbs?

A
  1. Key value stores
  2. Document databases
  3. Wide-Columnar Databases
  4. Graph databases
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is an example of a NoSQL key-value store?

A

Dynamo & Redis

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

What is an example of a NoSQL Document DB?

A

MongoDB

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

What is an example of a NoSQL Wide Columnar DB?

A

Cassandra & HBase

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

What are use cases for a wide columnar database?

A

Log data
IoT (Internet of Things) sensor data
Time-series data, such as temperature monitoring or financial trading data
Attribute-based data, such as user preferences or equipment features
Real-time analytics

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

What is the difference between a row based DB vs a column based DB?

A

Columns are stored together on disk vs rows

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

What are columnar databases good for?

A

Columnar databases are great for data analytics. They scan fewer rows and process less data than row-oriented databases.

Because only the necessary columns are read from storage, I/O costs and time are minimized, providing an edge over traditional row-based databases in analytics scenarios.

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

What is an example of a NoSQL graph database and what’s a good use case?

A

Neo4J, movie recommendations

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

What is the difference in scalability between NoSQL vs SQL dbs?

A

SQL dbs are vertically scaleable, but horizontally scaling is very challenging. NoSQL dbs are horizontally scalable.

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

What is the different in data integreity guarantees between NoSQL and SQL?

A

Reliability or ACID Compliancy (Atomicity, Consistency, Isolation, Durability): The vast majority of relational databases are ACID compliant. So, when it comes to data reliability and safe guarantee of performing transactions, SQL databases are still the better bet.

Most of the NoSQL solutions sacrifice ACID compliance for performance and scalability.

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

What is atomicity?

A

Atomicity guarantees that each transaction is treated as a single “unit”, which either succeeds completely or fails completely

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

What is consistency?

A

Consistency ensures that a transaction can only bring the database from one consistent state to another, preserving database invariants:

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

What is isolation?

A

Isolation ensures that concurrent execution of transactions leaves the database in the same state that would have been obtained if the transactions were executed sequentially

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

What is durability?

A

Durability guarantees that once a transaction has been committed, it will remain committed even in the case of a system failure (e.g., power outage or crash)

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

Why use a relational DB?

A

We need to ensure ACID compliance and data is structured and unchanging (scaling not needed).

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

Why choose NoSQL db?

A

Storing large volumes of data that often have little to no structure.

Making the most of cloud computing and storage. Cloud-based storage is an excellent cost-saving solution but requires data to be easily spread across multiple servers to scale up.

Rapid development. NoSQL is extremely useful for rapid development as it doesn’t need to be prepped ahead of time