← All system designs

Distribution

Going across machines — communication basics, RPC, and distributed file systems (NFS, AFS).

3 items 2 Intermediate 1 Advanced

Distribution is where the OS abstractions you mastered locally — files, processes, address spaces — get extended across machines. The Distribution topic covers the two foundational patterns: the canonical distributed-file-system designs (NFS and AFS) and the communication abstractions (reliable channels, RPC, idempotency) they were built on.

For interview prep, know NFS vs AFS as the two canonical cache-coherence strategies (stateless per-block invalidation vs stateful whole-file callbacks). The same trade-offs reappear in every modern distributed cache, from CDN purges to Spanner lease expiries.

Key concepts

  • IP is best-effort — anything stronger is built on top
  • RPC is the dominant abstraction; the semantics (at-most-once vs at-least-once) are the interview hot-spot
  • NFS is stateless per-block; AFS is stateful with whole-file callbacks
  • Idempotency is what lets at-least-once retries be safe
  • Caching strategy determines scale; consistency model determines correctness

Reference template

// Reasoning about a distributed call
1. What guarantees does the channel give?  (best-effort / at-least-once / exactly-once)
2. Is the operation idempotent?            (if not, you have a retry problem)
3. Where is the state?                     (server? client cache? both?)
4. How is the cache kept consistent?       (TTL? callback? validation per call?)
5. What happens on partition?              (degrade, fail, queue?)

Adapt to your problem; the structure is the load-bearing part.

Common pitfalls

  • Assuming TCP fixes everything — it gives byte-stream ordering, not idempotency
  • Caching writes without a coherence strategy — "works until someone else writes"
  • Skipping at-most-once design for non-idempotent operations
  • Treating partition as an availability problem; it is a consistency problem too

Related topics

Items (3)

Search ESC

Keyboard shortcuts

Shortcuts are disabled while typing in inputs.