Consistency Models Flashcards

(10 cards)

1
Q

What is strong consistency?

A

Strong consistency guarantees that all reads return the most recent write. All replicas are synchronized. Provides linearizability but may sacrifice availability and performance. Used when correctness is critical.

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

What is eventual consistency?

A

Eventual consistency guarantees replicas will converge given no new updates, but allows temporary inconsistencies. Higher availability and performance but stale reads possible. Used in distributed systems.

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

What is causal consistency?

A

Causal consistency preserves cause-and-effect relationships. If operation A causally depends on B, all nodes see B before A. Weaker than strong, stronger than eventual. Good middle ground.

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

What is read-your-writes consistency?

A

Read-your-writes ensures a user sees their own updates immediately, even if other users might not. Session-level consistency. Common in social media where users expect to see their own posts.

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

What is monotonic read consistency?

A

Monotonic reads ensure that if a user reads a value, subsequent reads will never return older values. Prevents time going backwards. Important for user experience.

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

What is quorum consistency?

A

Quorum requires majority of replicas to agree for reads/writes. With N replicas, reads from R nodes and writes to W nodes where R+W>N ensures consistency. Balances availability and consistency.

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

What is two-phase commit (2PC)?

A

2PC is a distributed transaction protocol ensuring atomic commits across multiple nodes. Phase 1: prepare/vote. Phase 2: commit/abort. Strong consistency but blocking and not partition-tolerant.

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

What is three-phase commit (3PC)?

A

3PC improves 2PC by adding a pre-commit phase to avoid blocking. Better partition tolerance but more complex. Rarely used in practice due to complexity vs benefits.

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

What is vector clock?

A

Vector clocks track causality in distributed systems using version vectors. Each node maintains a vector of timestamps. Helps detect concurrent updates and resolve conflicts in eventual consistency.

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

What is the Last Write Wins (LWW) strategy?

A

LWW resolves conflicts by keeping the update with latest timestamp. Simple but can lose data if clocks drift or concurrent writes occur. Used in systems prioritizing availability over consistency.

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