SQL, NoSQL, Sharding Flashcards

1
Q

What is a shard in a horizontally scaled database?

A

It’s a horizontal partition of your database

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

What are the pros/cons of sharding your database?

A

Pros: It allows ultimate resiliency by backing up specific pieces of your data. Scalable as your database grows
Cons: It can get complicated joining/merging shards back together, so you need to be aware of how to best organize your data across partitions to minimize them

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

What is MongoDB?

A

It’s a distributed NoSQL database which stores and partitions data based on key-value pairs, and manages replication

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

What is Amazon RDS?

A

It’s a service in AWS that manages relational database servers and allows you to quickly query structured data

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

What is Amazon Redshift?

A

It’s a service in AWS that supports data warehouse/lake approaches, enabling it to access and analyze huge amounts of data

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

What are the scalability differences between RDS and Redshift?

A
  • RDS can only scale vertically, but can generate multiple read replicas to support increased user traffic.
  • Redshift can scale vertically and horizontally due to the nature of how it distributes data across nodes
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the tradeoffs between RDS and Redshift?

A

RDS delivers fast query searches and is cheaper, however it can only scale vertically which is a limitation if you need to deal with lots of data. Redshift can scale horizontally, allowing it to store massive amounts of data. However, queries can take much longer due to the time it takes to query multiple nodes.

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

What does it mean that SQL databases follow a relational model?

A

It means that structured data is stored in tables, and foreign keys are used to form relationships across multiple tables

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

What does it mean that NoSQL databases follow a non-relation model?

A

It means that data is stored as documents, key-value pairs, or graphs where there is no defined schema

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

What’s another name for NoSQL databases?

A

Sharded databases

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

What is the “hot spot” or “celebrity” problem in NoSQL databases?

A

A “hot spot” is a shard that gets much more traffic than any other shard for whatever reason. Because of this, you need to be aware/scale for this type of increased traffic.

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

What are the main traits of normalized data?

A

Less storage space, more lookups (because data is stored in separate tables), updates happen in one place (one table)

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

What are the main traits of denormalized data?

A

More storage space (because data is often redundant to keep relevant data close together), one lookup (assuming you organized relevant data together), updates are difficult (because you have to update multiple instances of the same data)

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

What is a big determining factor on whether or not you denormalize your data?

A

It largely depends on the types of calls you plan on making to the data for the overall customer experience

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