I am working with microservices architecture using consul for service discovery and ECS for maintaining docker containers
Now I am Developing a micro service which will read record from AWS SQS and after some validation it will be inserted into SQL.
Problem For scalability suppose we launch two containers A and B say and if both A and B tries to update same record on SQL then how can I manage isolation and avoid race condition
One solution not sure I think can be to have some tokens on Elasticache aws service
However would appreciate if somebody can share his proven solution to work on this kind of use cases