title: How do database vendors implement transactions?
body: <p>When working with database it is often essential to use transactions. Say for example that I want to transfer a certain amount of money from account A to account B. This involves two queries: </p>
  
  <ul>
  <li>decrease the money in account A </li>
  <li>increase it in account B.</li>
  </ul>
  
  <p>In theory I can make the queries separately, but errors happen. So, to be sure, I can pack the two queries inside a transaction and be sure that either both operations end regularly or nothing has changed at all. No money disappears or is created.</p>
  
  <p>The problem is that it seems to me that this only shifts the responsibility from me to the database vendor. Now it is up to the database to make both operations and be sure that either both are made or nothing has changed. And the database developers face the same problems that errors happen.</p>
  
  <blockquote>
    <p>What techniques do database vendors use to ensure safety for transactions?</p>
  </blockquote>