Distributed systems Flashcards
What is the key difference between distributed and parallel systems?
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.
What are the fallacies of Distributed systems?
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
What does Amdahl’s law tell us?
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.
What are the key problems with distributed systems?
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 do we deal with time being unreliable?
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.
What is the difference between Total ordering, Total Causal ordering, and Partial Causal ordering?
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 do we make decisions in distributed settings?
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.
What are four properties to consensus algorithms?
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
What is the Byzantine fault tolerance?
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.
What is the CAP theorem?
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.
What types of guarantees does a linearisable system offer?
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.