Idempotency Pattern
Learn Idempotency Pattern (Advanced Microservices Patterns, Microservices Design Patterns) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
What Does Idempotent Mean? An operation is idempotent if calling it once has the exact same effect as calling it multiple times. This matters enormously in distributed systems because retries are unavoidable - a client may not know whether its request actually reached the server (the response was lost, not the request), so it retries "just in case" - and if the original request DID succeed, that retry must not cause a duplicate effect (e.g. charging a customer twice). Naturally Idempotent vs Not • Idempotent by nature: setBalance(100) - calling it 5 times still leaves the balance at exactly...