Distributed Systems Flashcard

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall with Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/34

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No study sessions yet.

35 Terms

1
New cards

Go Variable Scope (Q1.1)

Shared by all goroutines (threads). It is the same variable in memory, not a new copy.

2
New cards

Race Condition (Q2.1)

When multiple threads access a shared variable at the same time, and at least one writes. The result is unpredictable.

3
New cards

sync.Mutex (Q2.1)

A lock in Go. You use mu.Lock() before and mu.Unlock() after accessing a shared variable to prevent data corruption.

4
New cards

Deadlock (Q1.2)

A state where two or more processes are stuck forever, each waiting for a resource the other one holds.

5
New cards

Starvation

A process is ready to run but is indefinitely ignored or passed over (e.g., a low-priority job) while other processes get resources.

6
New cards

Livelock

Processes are active and busy (changing state), but make no actual progress. Like two people stuck in a hallway, constantly dodging each other.

7
New cards

TCP (Q1.3)

A reliable network protocol. It guarantees all data arrives in the correct order. (Like a phone call).

8
New cards

UDP (Q2.4)

An unreliable network protocol. It's fast, but packets ("datagrams") can be lost or arrive out of order. (Like a postcard).

9
New cards

IP (Q1.3)

The Network Layer protocol. Its job is addressing and routing packets from one computer to another.

10
New cards

Transport Layer (Q1.3)

The layer that manages communication for specific processes (using ports). TCP and UDP live here.

11
New cards

Microservices

An architecture style that builds one big application as a set of many small, independent services.

12
New cards

RPC (Remote Procedure Call)

A way to call a function on a remote server as if it were a local function in your own code.

13
New cards

RPC Limitation (Q1.4)

It's a "leaky abstraction." It hides the network, but the network is not reliable. This causes partial failures (e.g., the call works, but the answer is lost). 16

14
New cards

gRPC

A fast, modern RPC. Uses HTTP/2 and Protocol Buffers (binary format). Good for internal microservice communication.

15
New cards

REST

An API style based on resources. Uses HTTP/1.1 (GET, POST) and JSON (text format). Good for public/web APIs.

16
New cards

API Gateway

A single "front door" for all clients. It receives requests and routes them to the correct internal microservice.

17
New cards

Service Discovery

A "phone book" for microservices. It helps services find the network address (IP:port) of other services they need to call.

18
New cards

Circuit Breaker

A safety pattern. If a remote service keeps failing, the "breaker" trips (opens) and fails requests immediately to let the service recover.

19
New cards

Saga Pattern

Manages distributed transactions. If a step fails, it runs compensating transactions (rollbacks) to undo the previous steps.

20
New cards

Clock Drift (Q1.5)

The problem where physical computer clocks are imperfect and slowly run at different speeds, "drifting" apart from each other. 22

21
New cards

Clock Discontinuity (Q1.5)

When a clock suddenly jumps forward or backward in time, usually because it's being synced by NTP (Network Time Protocol). 27

22
New cards

Lamport Timestamps (Q1.6)

A logical clock (a counter). Guarantees: If A happened-before B, then $L(A) < L(B)$. 30

23
New cards

Lamport Weakness (Q1.6)

If $L(A) < L(B)$, it does not mean A happened-before B. They could be concurrent (unrelated). 30

24
New cards

Vector Clocks

An advanced logical clock. Guarantees: A happened-before B IF AND ONLY IF $V(A) < V(B)$. Can detect concurrent events. 33

25
New cards

Centralized Mutex (Q1.7)

A distributed lock controlled by one coordinator server. Its main weakness is being a Single Point of Failure (SPOF). 41

26
New cards

Ricart & Agrawala (Q2.2)

A decentralized lock algorithm. To enter, a node must get a REPLY from all other nodes. 47

27
New cards

R&A Weakness (Q2.2)

Not fault-tolerant. If any node crashes or a REPLY message is lost, the requesting node will starve (wait forever). 48

28
New cards

Byzantine Fault (Q1.8)

A faulty node that is malicious. It can lie and send different messages to different nodes to cause confusion. 54

29
New cards

Byzantine Tolerance (Q1.8)

To tolerate $f$ malicious nodes, you must have a total of $N \ge 3f + 1$ nodes. (Less than 1/3 can be traitors). 54

30
New cards

RAFT (Q1.9)

A leader-based consensus algorithm. One node is elected leader and manages log replication. 60

31
New cards

RAFT Network Partition (Q1.10)

Only the partition with a majority of nodes can elect a new leader and commit new entries. The minority partition is "offline" and can't make progress. 69

32
New cards

Linearizability (Q2.3)

Strong consistency for a single object. Guarantees every operation appears to happen instantly at one point in time. Respects real-time order.

33
New cards

Serializability

Strong consistency for transactions (groups of operations). Guarantees the result is the same as running them one-by-one in some serial order.

34
New cards

Strong Consistency

A model where all reads are guaranteed to see the most recent write. Data is instantly the same everywhere.

35
New cards

Eventual Consistency

A weak model. Guarantees that if no new updates occur, all nodes will eventually converge to the same value. Allows temporary "stale" (old) reads.