<p>i do not 100% understand if SpringBatch, in a multi-instanz Kubernets application, work fine. I read <a href="https://stackoverflow.com/questions/60924076/batch-processing-on-kubernetes">Batch Processing on Kubernetes</a>, so i understand that in general it works fine, but in the answer it is not mentioned that it works fine in a multi-instanz installation using ONE database.</p>
<p>Our setup looks like this: We have multiple instances of the application running in Kubernets and they sharing ONE database. Some jobs would be triggered by user interaction (in one of the many pod's that is answering the request from the UI) and some are triggerd by cronjob from kubernetes (eg data reorg) (in one of the many pod's that is answering the REST request from the cronjob). All pods are containing the incidental application.</p>
<p>Does this setup work fine with SpringBatch?</p>
<p>thanks for your help :-)</p>

user286974
<p>As far as Spring Batch is concerned, all these things are deployment details. It is up to you to design your jobs and job instances with that in mind. This is what I explained in details in the <a href="https://spring.io/blog/2021/01/27/spring-batch-on-kubernetes-efficient-batch-processing-at-scale#2-choosing-the-right-spring-batch-job-parameters" rel="nofollow noreferrer">Choosing the right Spring Batch job parameters</a> and <a href="https://spring.io/blog/2021/01/27/spring-batch-on-kubernetes-efficient-batch-processing-at-scale#3-choosing-the-right-kubernetes-job-deployment-pattern" rel="nofollow noreferrer">Choosing the Right Kubernetes Job Deployment Pattern</a> sections. Note that this blog post is linked in the answer you shared.</p>
<p>What Spring Batch guarantees, thanks to the centralized job repository design (which is what you are referring to as &quot;ONE database&quot;), is preventing duplicate and concurrent job executions of the <em>same job instance</em>.</p>
<p>So the answer to your question is yes, as long as you choose the right deployment pattern for your Spring Batch jobs and Kubernetes jobs.</p>
