4 Failures In Communication

Communication fails when:

  1. Packet dropped
  2. Serve crashed
  3. Slow server
  4. Network link broken

Client sees:

  • Timeout

At Least once

  • client send request until receive response
  • Idempotent
    • system can receive duplicates of the request, no worries

At most once

  • server will only execute once, filter out duplicates
  • Replies to duplicate request by result it computed the first time
  • Problems
      1. more and more seen messages to keep track of
      • solution: Client ACKs when receives response, so server can delete keep track
      1. Concurrent request from same user, out of order
      • duplicate detection (like using sequence numbers) can break
      1. Client resends while server is still executing
      • solution: server must track “in-progress” calls to avoid running same operation twice
      1. Server crashes
      • solution: after restart, server must remember past requests (persistent log) to avoid re-executing duplicates

Exactly Once

  • combine at least once and at most once
  • We can not 100% guarantee that this process will finish.