We have an environment where we run multiple spring boot web services all linked to a single database schema. All of them are registered to Eureka and a gateway is responsible of accepting client requests and routing to a certain instance based on the load balancing strategies. My question is that in case we have a job on these instances or in case for a certain reason we receive a request twice and each request was routed to a different instance, how can we prevent executing the same request twice?
What i know is that shedlock lib and spring zookeeper can secure a job from being executed at the same time under two instances, but if we do want jobs to exeucte together for better performance but not to execute same transaction id at the same time, what is the best solution for this?
What about not executing same api request twice if received 2 times?
should we just use redis as external system and do a get on a map of transaction ids before executing the transaction? or is there any "spring boot" way to do it?
our target is also to choose a light solution, with best performance and less integration code