I am working on a web application with Spring (Boot, MVC), and there will be some things that need to be run in the background, so I am not blocking the request.
Currently, I was thinking that the Spring batch job runs every 5 minutes and checks in the table (jobs_queue) in the database if there is anything to do, and then perform the tasks (assuming that each row in the table is required).
Obviously, this is not a good scalable solution (I think), since I will have only one worker (if there are too many tasks in the queue, this only worker may not cope with the load), and he will also have at least one DB query every 5 minutes (you can also see if there are jobs in the queue).
Which is better for this?
java spring spring-boot spring-batch spring-mvc
daniels
source share