Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

How to skip locked table row in a high available distributed system

NotificationsYou must be signed in to change notification settings

asterixcode/spring-ha-sql-skip-lock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

Sample code forSELECT ... FOR UPDATE SKIP LOCKED using Spring Boot and JPA.

Use Case example

A scheduled job in a high available environment that fetches data from a database table and processes it.

Description

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.

Credits

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

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp