In a distributed system, how atomic operations are done when network connections inherently have the Two Generals problem?

Does atomicity have a different meaning in this context?


2 Answers 2


There is one primary meaning of the word "atomicity", and one additional property that some people use on occasion.

The primary meaning is that a complex operation (usually called a "transaction"), which requires multiple parties to take action, either happens or doesn't happen. It can't happen only in part.

One classic example (because this is one domain where atomicity is more important than most other considerations) is transferring money from one bank account to another bank account at a different bank. Think of the banks as communicating agents (possibly involving other agents, like an arbitrator or broker). Conceptually, one bank needs to subtract some amount from a number held somewhere, and the other bank needs to add the same amount. The important part is that either both pieces of arithmetic happen or neither happen. What is not allowed is for money to be created or destroyed.

The additional property that some people add is that all agents, or at least the initiating agent, must be able to know in a timely manner whether the transaction happened or didn't happen. Think of a file system sync operation, for example. If that operation returns and signals that it was successful, the client can assume that any data and/or metadata written to the file system before the sync operation has been committed to secondary storage.

  • $\begingroup$ If you have a multi-tenant store, how you make the transaction atomically? $\endgroup$
    – Mohsen
    Commented Sep 3, 2015 at 6:10
  • $\begingroup$ Perhaps I don't understand the question, but a multi-tenant store is no different conceptually from a filesystem which multiple processes are using at the same time. $\endgroup$
    – Pseudonym
    Commented Sep 3, 2015 at 6:34
  • 2
    $\begingroup$ @Mohsen It's a difficult problem. $\endgroup$ Commented Sep 3, 2015 at 8:51

Atomicity is different in terms of distributed systems. An atomic operation in distributed systems is an operation whose execution is performed as an individual action.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.