Part 5: The Idempotency Layer
In a distributed system, network errors lead to retries. If a consumer receives the same message twice, it must not execute the logic twice.
1. Idempotency Keys
The client or producer attaches a unique to every request. The consumer stores this key in Redis or a DB. If the key exists, the request is ignored.
