This query changed how my processor behaves under load.

Using FOR UPDATE SKIP LOCKED in PostgreSQL allows multiple service instances to safely claim work without stepping on each other.
Each instance locks only the rows it processes, while others move on to the next available batch.

It’s a small detail, but combined with short-lived transactions it keeps lock duration predictable and prevents instances from blocking each other.

Next step is running it with multiple instances.

#microservices