Systems Design Flashcards

1
Q

CAP Theorem

A

No distributed system is safe from network failures, thus network partitioning generally has to be tolerated.

In the presence of a partition, one is then left with two options: consistency or availability.

When choosing consistency over availability, the system will return an error or a time out if particular information cannot be guaranteed to be up to date due to network partitioning.

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

Consistency

A

reads are always up to date, which means any client making a request to the database will get the same view of data

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

Availability

A

database requests always receive a response (when valid)

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

Meaning of CAP Theorem

A

Consistency – that reads are always up to date, which means any client making a request to the database will get the same view of data.
Availability – database requests always receive a response (when valid).
Partition tolerance – that a network fault doesn’t prevent messaging between nodes.

In the context of distributed (NoSQL) databases, this means there is always going to be a trade-off between consistency and availability. This is because distributed systems are always necessarily partition tolerant (ie. it simply wouldn’t be a distributed database if it wasn’t partition tolerant.)

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

Long Polling vs Short Polling

A

In almost all cases, Amazon SQS long polling is preferable to short polling. Long-polling requests let your queue consumers receive messages as soon as they arrive in your queue while reducing the number of empty ReceiveMessageResponse instances returned.

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