We are using cloudformation template to create multiple EC2 instances. We have Auto scaling and ELB defined. Each EC2 instance runs with its own Tomcat server and a web application. We connect to SQS to pull messages and write to RDS database from this web app.
Problem statement - We do not want both EC2 instances pulling the same message from SQS and writing to RDS. Could you please direct me on how to make this process efficient?