- Notifications
You must be signed in to change notification settings - Fork0
asterixcode/spring-ha-sql-skip-lock
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Sample code forSELECT ... FOR UPDATE SKIP LOCKED using Spring Boot and JPA.
A scheduled job in a high available environment that fetches data from a database table and processes it.
In a high available distributed system, a job runs on multiple application nodes/instances, but each node should process a different set of data and the data should not be processed by more than one node.
The data is fetched from a database table and a lock is acquired on the data to prevent other nodes from processing the same data.
The lock is released after the data is processed, but this is not optimal for the performance.
Therefore, each node should not wait for the lock to be released when the data is already being processed by another node.
The node should instead skip the data that is already being processed by another node and process the next available data.
Inspired by the Spring I/O 2024 Barcelona talk byRafael Ponte
YouTube linkDistributed Scheduling with Spring Boot: the challenges & pitfalls of implementing a background job
About
How to skip locked table row in a high available distributed system
Topics
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.