Distributed systems Flashcards

1
Q

What is the key difference between distributed and parallel systems?

A

Parallel systems have shared memory. All processors use the same memory.
Distributed systems do not have any shared components. Each processor has its own memory.

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

What are the fallacies of Distributed systems?

A
There are 7 fallacies of Distributed systems
The network is reliable
The latency is 0
The bandwidth is infinite
The network is secure
The topology does not change
The transport cost is zero
The network is homogenous
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does Amdahl’s law tell us?

A

Amdahl’s Law indicates the potential speedup if you parallelize part of the system, giving an upper bound on it.
It implies that the performance gain through parallelization drop sharply if even a small fraction is serial.

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

What are the key problems with distributed systems?

A

There are Four main problems:
Unreliable networks (Distributed systems are reliant on sharing data)
Unreliable time (There is delay in the distribution system, which can cause ordering problems)
No single source of truth (a distributed system requires coordination)
Different opinions (different locations can have different answers, which can result in a lack of consistency)

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

How do we deal with time being unreliable?

A

Using either NTP (network time protocol) to sync time (accuracy of ms), Lamport timestamps for partial causal ordering (rely on ‘happens before’ relationships), or vector clocks for total causal ordering, the latter of which is considered the best possible.

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

What is the difference between Total ordering, Total Causal ordering, and Partial Causal ordering?

A

Total ordering assumes that the message rate is globally bounded, and that a synced Real Time Clock can be used to maintain order.
Total Causal ordering relies on Happens before relationships, and can guarantee that the order is reliable
Partial Causal ordering relies on Happens before relationships, but cannot guarantee that the order is reliable

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

How do we make decisions in distributed settings?

A

Decisions are determined by consensus, ie through voting.
This process has four steps
Committing a transaction
Syncing state machine
Leader election
Atomic broadcast
The most common algorithm for this is the Raft consensus algorithm, which selects one server to act as leader until it breaks. This leader accepts commands from clients, appends it to its own log, and replicates it to other servers, to override inconsistencies.

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

What are four properties to consensus algorithms?

A

Safety: Never returning an incorrect result, in the presence of non- Byzantine conditions.
Availability: Able to provide an answer if n/2+1 servers are operational
No clocks: They do not depend on RTCs to work
Immune to stragglers: If n/2+1 servers vote, then the result is considered safe

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

What is the Byzantine fault tolerance?

A

The Byzantine fault tolerance indicates the resilience against suboptimal voting. That is, by creating Public Key cryptography and node registration before starting a distributed system, that system is more resilient to Man in the Middle (MITM) attacks.

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

What is the CAP theorem?

A

The CAP theorem supposes that there are 3 guarantees any distributed system can provide, and it is speculated that only 2 of 3 can be provided. These are:
Consistency: All nodes have the same data at the same time
Availability: Every request receives a response from the system about whether it succeeded or failed
Partition tolerance: The system continues to operate, despite arbitrary partitioning due to network failures
In practice, a system can provide all 3 guarantees, so long as the network is functioning.

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

What types of guarantees does a linearisable system offer?

A

All writes Change the value of the shared memory.
Any read always return the latest value from the storage.
The system guarantees that no read can give an inconsistent result, meaning that, if some A and B are reading the same object at the same time, their results are the same.

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