MODULE 4: DISTRIBUTED COMPUTING AND SERVICE-ORIENTED ARCHITECTURES Flashcards

(22 cards)

1
Q

What is a distributed system?

A

A distributed system consists of multiple autonomous computers/processors connected via a network, collaborating to achieve a common goal. Unlike parallel systems, distributed systems feature separated memory, geographic distance, modularity, reliability, scalability, and often heterogeneity. Failures are partial—one node or link may go down without halting the whole system.

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

List and explain three fundamental challenges in distributed computing.

A
  1. Absence of shared memory—each processor manages distinct state.
  2. Absence of shared clock—different nodes cannot perfectly synchronize time due to variable network delays.
  3. Failure detection—hard to distinguish between a failed or merely slow node, making reliable coordination more complex.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the main motivations for distributed systems?

A

Scalability, resource sharing, data sharing, reliability via redundancy, cost-effectiveness via commodity machines, geographic distribution, and resilience to local failures.

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

Explain the CAP theorem and its practical implications.

A

The CAP theorem states that a distributed data system can simultaneously provide only two of:

  • Consistency (C): All nodes see the same data at the same time.
  • Availability (A): Every request receives a response, even if some nodes are down.
  • Partition Tolerance (P): System continues to operate despite network splits.
    Partition tolerance is essential for any network system, so designers must choose between strict consistency (sacrificing availability) and high availability (sacrificing consistency) if a network partition occurs.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Why is latency a critical concern in distributed systems?

A

Network latency affects both consistency and availability; slow communication can mimic partitions, requiring systems to balance immediate response with up-to-date data, leading to fundamental trade-offs in system design.

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

How do distributed systems model computation and communication?

A

Applications consist of sets of processes communicating via channels (messages), with no assumptions about message ordering, delivery time, or shared state. Most models are asynchronous; messages have arbitrary delays, and each process maintains local state and reacts to events.

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

Distinguish between the “event” and “state” models for distributed computation.

A

Event models focus on the sequence and causality of events (message sends/receives, local computations), while state models focus on snapshots of system configuration. Event models are more flexible for asynchronous, unpredictable behaviors.

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

Explain Lamport’s “happened-before” relationship and its importance.

A

Lamport’s relation expresses potential causality: if event A could have affected event B (via local sequence or message transfer), then A “happened before” B. It enables reasoning about global system order, detecting concurrency, and tracking dependencies for algorithm design.

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

What are logical clocks, and how do they help track causality?

A

Logical clocks, like Lamport clocks, assign monotonically increasing timestamps to events. Causally related events always have increasing timestamps, allowing distributed systems to impose partial or total order for coordination and debugging.

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

What are vector clocks, and how do they extend logical clocks?

A

Vector clocks use arrays—each process maintains a vector of counters for all processes. When sending/receiving messages, vectors are updated. Vector clocks detect true causal concurrency and allow systems to order events, resolve conflicts, and observe distributed state more precisely.

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

What is the distributed mutual exclusion problem?

A

Like the critical section in concurrency, distributed mutual exclusion ensures that multiple distributed processes do not simultaneously enter a critical section. Safety (exclusion), liveness (eventual access), and fairness (order of access) must be guaranteed, but communication delays and failures complicate the solution.

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

Briefly describe Ricart-Agrawala’s decentralized mutual exclusion algorithm.

A

A process sends timestamped requests to all others; each responds with OK if not interested in the resource or has a higher timestamp. When a process receives OK from all, it enters the critical section. To release, a process sends OK to all pending requesters. The scheme ensures exclusion and fairness via timestamps and message passing.

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

What is leader election, and what does the Chang-Roberts algorithm do?

A

Leader election designates a unique coordinator among processes.
Chang-Roberts: In a ring, processes send election messages with their IDs. Each forwards higher IDs, swallows lower ones. Receiving its own election message declares leadership; leader status then propagates. The highest ID wins. Used for centralized coordination in algorithms.

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

Explain message ordering in distributed algorithms—causal, FIFO, and total ordering.

A
  • Causal ordering: messages reflecting “happened-before” must be delivered in order (no overtaking).
  • FIFO ordering: messages from the same sender arrive in sent order (weaker than causal).
  • Total ordering: all nodes deliver multicasted messages in the same global order. Used for consensus, replicated state machines, atomic broadcasts.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is a global snapshot and what challenge does it solve?

A

A global snapshot records a consistent state of a distributed system across all processes, usually for debugging, deadlock detection, or checkpointing. The challenge is synchronizing such snapshots without pausing processors or missing in-transit messages.

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

Summarize the Chandy-Lamport snapshot algorithm.

A

Processes mark their local state and broadcast “marker” messages, recording incoming messages after marking (to capture in-transit traffic) until markers are received on all channels. After, the joint record describes a consistent, concurrent global state.

17
Q

What is the distributed consensus problem, and why is it hard?

A

Consensus means all non-faulty nodes agree on a single value (e.g., commit/abort, leader). In asynchronous networks, consensus is impossible if any process can fail undetectably (FLP impossibility). Requires careful algorithm design under partial synchrony or using failure detectors.

18
Q

How does Byzantine failure differ from crash/omission failure, and what’s the Byzantine Generals problem?

A

Byzantine failures involve arbitrary, malicious, or inconsistent process behavior—not just crashing or omitting messages. Byzantine Generals: requires loyal nodes to agree on a plan despite faulty, traitorous participants. Solvable only if number of correct nodes exceeds three times the faulty ones.

19
Q

Name and explain a real consensus protocol (e.g., Paxos or Raft).

A
  • Paxos: nodes propose values, acceptors vote, and a “leader” finalizes decisions; ensures safety (once chosen, value is immutable) and liveness. Complex but widely used.
  • Raft: simpler than Paxos; leader manages replicated log, heartbeats maintain authority, clients submit commands to leader only, and servers agree on log entries. Used in replicated databases, distributed filesystems.
20
Q

What is Service-Oriented Architecture (SOA), and what are its principle benefits?

A

SOA decomposes applications into loosely-coupled, network-accessible services with formal contracts.
Advantages: modularity, maintainability, independent deployment, cross-platform interoperability, and enhanced scalability. Services expose APIs, interact via messages, and can be scaled, reused, or replaced without affecting clients.

21
Q

Compare SOAP-based and REST-based web services (SOA).

A
  • SOAP: XML-based, strictly-typed messages, WSDL schemas, suited for enterprise integration, supports advanced features (security, transactions).
  • REST: HTTP-based, resource-oriented, with simpler URLs and standard verbs (GET, POST, PUT, DELETE); easier to use, lightweight, ideal for web/mobile APIs.
22
Q

How do microservices extend SOA ideas for distributed application architecture?

A

Microservices break applications into independently deployable, single-responsibility services, each running in its own process and communicating via REST or lightweight messaging. Enables horizontal scaling, polyglot development, continuous deployment, and faster time-to-market.