4 Failures In Communication
Communication fails when:
- Packet dropped
- Serve crashed
- Slow server
- 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
- more and more seen messages to keep track of
- solution: Client ACKs when receives response, so server can delete keep track
- Concurrent request from same user, out of order
- duplicate detection (like using sequence numbers) can break
- Client resends while server is still executing
- solution: server must track “in-progress” calls to avoid running same operation twice
- 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.