How can I block several competitive actions in the database?
Now I use advisory lock in postgres, but maybe there are some other solutions? For example using redis? Serializable is not suitable for performance.
How can I block several competitive actions in the database?
Now I use advisory lock in postgres, but maybe there are some other solutions? For example using redis? Serializable is not suitable for performance.
perhaps the most common row level locks are right for you
http://postgrespro.ru/doc/explicit-locking.html#LOCKING-ROWS
that is, by issuing a SELECT ... FOR UPDATE command, you block to the end of the transaction the rows that were affected by the SELECT command. read the link there in detail and everything is written in Russian.
Source: https://ru.stackoverflow.com/questions/442521/
All Articles