Remote Procedure Calls (RPC)
Understanding the illusion of local execution in distributed systems.
compare_arrows RPC vs. REST
Focuses on actions. Like calling a function locally.
POST /rpc/rebootSystem
Focuses on resources (nouns). Uses HTTP verbs.
POST /systems/123/reboot-jobs
"RPC tries to make network communication look like a local function call, hiding the complexity of the network."
RPC Lifecycle Simulator
Handling Transient Failures
Simulate how different strategies handle a "flaky" service.
Client Service
Target Service
System Logs
Exponential Backoff
Instead of retrying immediately, wait $2^n$ seconds (plus random jitter) to avoid overwhelming a struggling server.
Circuit Breaker
If failures > threshold, "Open" the circuit (fail fast) to let the system heal. After a timeout, "Half-Open" to test if it's back.
Jitter
Adding randomness to retry intervals prevents "Thundering Herd" problems where all clients retry at the exact same millisecond.
Out-of-Order Delivery
How distributed systems reconstruct order from chaos using buffering and sequence numbers.
Sender (Strict Order)
Receiver (Re-ordering)
How it works
The receiver maintains a variable nextExpectedId. If a packet arrives with id > nextExpectedId, it is buffered. When the missing packet arrives, the buffer is checked to see if subsequent packets can now be processed in sequence.
Guaranteed Delivery & Idempotency
Solving the "Double Charge" problem when acknowledgments get lost.
Configuration
Scenario: Payment Processing
You are a payment service. The network is unreliable and drops ACK messages often.