Locking a resource for update process (ReadWrite lock) In Container Enviroment

59 Views Asked by At

I have a python application that accesses a database (PostgreSQL) with a master data in order to search within it - done by a search threads (A 150 mb database).

Once a day there is an update process that updates the database (drops and loads a new table) - during the update the search threads are blocked until the update is completed.

Today it is implemented using a Read-Write lock on the application level. Now we are moving into a search processes that each one of them runs in a docker container

What is the best way to achieve this functionality in the new environment? (Using distributed locks? explicit locking on the database level?...)

I saw the Redis implementation for distributed locks, seems that they are exclusive and not RW.

0

There are 0 best solutions below