Environment: Kubernetes Cluster with Spring Boot microservices. One microservice contains a database with a date in one column of a read-only table.
Problem/Requirement: When the date is reached, an event shall be triggered:
- some business logic is done
- containing a call to a third party system
- and the processing is logged in another database table (success or failure)
I see several ways for implementing this:
- a kubernetes cron job which accesses the database, checks the date and executes the logic.
- a Spring Boot cron job which ...
- a Spring Boot with quartz job
- a cron job which first writes all found entries into a queue and following cron jobs which process the queue?
- Spring Batch ?
- ???
The problems I see:
- Performance: There can be up to 100.000 entries in the database which are to be processed on the same day (even better in one hour). Each entry is handle in 1-2 seconds. (100.000 * 2s = 55h) This requires parallel execution.
- Several long running jobs which query the same data from the table (select * where date = today) will certainly conflict with each other.
What architecture would you suggest to solve this problem? What architectures have proved successful for this kind of problem?