I am developing a e-commerce web app using Spring , Hibernate and MySql.
For ex : In this app at the time of placing order for products , I am going to update Product table record , means going to reduce product count from this table. I am using mysql update query for that. Its working fine . but if I send 100 of request at a time then that product count is not decreasing properly.
For that I got two answer
I used messaging queue(RabbitMQ) to queued all request and reduce the count one by one
I have to use hibernate lock
So I need to know other possible way to do that work and from above two way which one is good ?