title: Database design: accounting transaction table
body: <p><strong>Storing the transaction entry into a double entry accounting database.</strong></p>
  
  <p>I came up with two solutions option 1 and option 2, I was told most banking package chooses option 2 for their database design. However I prefer option 1 over option 2 because it simply makes sense and it is more efficient! </p>
  
  <p>I.e For the 2 movement of funds, option 1 requires 2 records vs option 2 requires 4 records. </p>
  
  <p>I would like to know why the bank would choose option 2 over option 1? what is the reason for this? </p>
  
  <pre><code>Option 1)
  TRANSACTION
  Credit_AccountId
  Debit_AccountId
  Amount
  ...
  
  Option 2)
  TRANSACTION
  AccountId
  Amount
  ...
  </code></pre>