How Distributed Systems Avoid Race Conditions Using Pessimistic Locking? (scalablethread.com)
When two updates to a data source are executed in a single-process system, they are always run one after the other, as the process will only be working on one update at a particular time. However, in a multi-process system, there is a chance that the two updates can be executed at the same time by the processes on the shared data source.