How would you prevent a checkout retry from creating two orders?
Accept an idempotency key representing the user’s intended checkout operation and store it with a request fingerprint and result under a uniqueness constraint. Atomically associate the key with order ...