jeudi 1 octobre 2015

Creating duplicate entries when app runs concurrently

I have a web application that sits on 3 AWS instances. When an user has done something on the application, we insert a record to the database. There is a batch job that reads this database/table frequently and when it sees the the record_status is NEW, it picks the record up and log it on another system. And then this record is deleted from the database.

The above works fine when we only use 1 of the 3 instances. However, duplicate entries are inserted to the database when more than 1 AWS instances are enabled. How should I change the design to tackle this problem?




Aucun commentaire:

Enregistrer un commentaire