Strong vs. Eventual Consistency Flashcards

(9 cards)

1
Q

What does consistency mean within a distributed system?

A

Consistency refers to the property that all copies of data (across all servers or nodes) reflect the same state.

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

What are the two most common data consistency models?

A

Strong consistency and eventual consistency

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

What is Strong Consistency?

A

Strong consistency guarantees that all reads of data will return the most recent write after completed.

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

How is Strong Consistency typically achieved?

A

It’s achieved through the use of synchronous replication, meaning that the data will be written and acknowledged to all nodes (or a majority in a quorum configuration) before being considered successful.

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

What is a challenge introduced by the strong consistency model?

A

Strong consistency and its use of synchronous replication can introduce latency, typically via blocking, while waiting for the operations to be confirmed by all replicas.

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

What’s a classical example to use to demonstrate an appropriate case for strong consistency?

A

Banking or financial transactions as it’s critical that after any monies that may be spent are immediately reflected in the balance to prevent overspending.

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

What databases support strong consistency? What’s an example of a cloud offering that does so?

A

Most traditional databases and many modern ones support it. Google Spanner would be an example that is distributed but still provides strong consistency.

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

What are the two most common downsides of strong consistency? Explain each.

A

Latency and availability.

Latency is introduced via the nature of synchronous replication as every node/replica will have to confirm the operations. Since some systems may be widely distributed, there can be network latency involved.

In the same vein, availability can be compromised if any of the required nodes is experiencing issues and is unable to confirm an operation as the system would fail as opposed to compromising consistency.

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

What are the trade-offs of strong consistency and when you would choose it as a model?

A

Strong consistency sacrifices performance and potentially availability for the sake of accuracy. Said differently, absolute correctness at the cost of response times (and potentially availability during failures).

When correctness is absolutely critical, that’s when you should choose strong consistency.

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