I have a Pgpool system with several nodes working on master-slave mode. I also have some resources that have a high level concurrency and there are too many rollbacks.
I was thinking in two solutions:
Use
SELECT ... FOR UPDATE
queries to block rows and send it only to the master node (with pgpool select for update are not available). Actually, I would have to send the whole transaction at master.Use redis distribute locks to block each row, and use normal
SELECT
without locks.
Which solution is better? Any others solutions to solve that problem?