Database Flashcards

1
Q

What are the two general types of databases?

A

SQL (Relational) and NoSQL (Sometimes known as blob or key:value)

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

What are the features of a SQL Database?

A

SQL databases organize data into tables where columns represent attributes and rows represent records.
SQL databases are relational, allowing logical linking between data/tables.
SQL databases require a defined schema/structured data
SQL databases provide strong ACID guarantees

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

What are the features of a NoSQL Database?

A

NoSQL databases use non-relational semi/non structured data.
NoSQL databases are designed to be more flexible than relational databases.
NoSQL databases usually do not provide strong ACID guarantees as a trade off for speed/scaling.

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

What are the main differences between SQL and NoSQL databases?

A

Relational - SQL databases are relational (Tables where rows represent records and columns attributes, linked by logical relationships), NoSQL is generally not relational.
Schema - SQL databases are structued and have a pre-defined schema, NoSQL allows for dynamic schemas/unstructured data.
Scaling - SQL scales vertically, NoSQL horizontally.

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

When would you choose NoSQL over SQL?

A

Flexibility - SQL requires a strict schema, NoSQL does not require this and can be better for unstructured data.
Speed - NoSQL scales horizontally and due to being loose on ACID properties, can often be much faster than SQL
Volume - Because of the horizontally scaling nature of NoSQL, it can be better at handling a large number of requests (SQL is blocking/scales vertically, so it can get bogged down)

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

What are the (4) most common types of NoSQL databases?

A
  1. Key-Value
  2. Column Stores
  3. Document
  4. Graph
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Describe NoSQL Key Value Database

A
  • A unique identifier key, paired with an unstructured data value.
  • Optimized for reading/writing data at scale.
  • Good for scenarios that require high-volume fast responses, and commonly used for in-memory data caching.

Examples
DynamoDB

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

Describe NoSQL Columnar Database

A
  • Data is indexed by columns instead of in rows.
  • Good for data analytics as gathering all values for attributes requires scanning less rows.
  • Can be very useful for real-time analytics or time-series data

Examples
Redshift

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

Describe NoSQL Document Database

A
  • Data is stored in documents (Like JSON, YAML, CSV) instead of tables and rows
  • Documents are semi-structured data, that can evolve as the application changes.
  • Good for scenarios with frequently changing data, and scaling being primary concerns.

Usecases
* Content Management
* Sensor Data
* IoT

Examples
MongoDB

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

Describe NoSQL Graph Database

A

Specialized database that stores data as a network of connected nodes/edges. Nodes represent data/entities, edges represent the relationships between them. Prioritizes connections rather than data.

Usecases
* Social Networks
* Recommendation Systems

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