Atomicity of a three-layer trade
Each trade has to be saved across three systems at once (queue → transactional DB → public registry). Any of them can fail. If the order is wrong — you get either a phantom trade with no public record, or a lost transaction.
Solution → A background processor acks the queue request only after successful INSERT and append in both stores. If the public publish failed — re-check whether the entry already exists (race-safe), then retry. Guarantees "at-least-once delivery" without duplicates.