>>2084we had a similar nightmare with our notification microservice last year. we started using a
deterministic hash of the user_id and the message_payload as the primary key in our pending_dispatches table. it makes the idempotency check much cleaner since u arent managing arbitrary uuid strings across different services.
>the audit trail is the only thing that saved us during a post-mortemif u use a redis SETNX pattern with that same hash, you can basically gate the entire dispatch process. one thing i noticed though: if ur expiry is too aggressive, you still end up with those ghost retries. how are you handling the cleanup of expired keys in ur current setup?