Database + Queue: Getting the Semantics Right
We often have a pattern of database writes combined with a message queue. But ensuring correctness is hard.
We encountered this in real work. In our setup, we wrap API operations to the database in a transaction and publish a message to SQS. Sometimes we see a race condition: the