Lock doesn't work in distributed system
ostar0816 opened this issue · 2 comments
@rogierschouten
This works perfectly locally but when it doesn't work on the live, which has 2 kubernetes pods handled by load balancer. It will be no problem with single pod but you know, usually in live environment we have multiple processes running to handle concurrent requests in a distributed way, like in my example or on heroku with multiple dynos.
Is there any solution to overcome this problem?
Thanks in advance and stay safe.
@ostar0816 google for 'distributed systems', 'distributed locking', or 'distributed transactions'. You will likely end up with a system redesign (stateless services that don't require locking) or with two-phase commits.
@ostar0816 also lookup the PAC theorem. It tells you when something is impossible, so that you have a solid argument for getting your requirements lessened