title: What is the best practice database design for transactions aggregation?
body: <p>I am designing a database which will hold transaction level data. It will work the same way as a bank account - debits/credits to an Account Number.</p>
  
  <p>What is the best / most efficient way of obtaining the aggregation of these transactions. </p>
  
  <p>I was thinking about using a summary table and then adding these to a list of today's transactions in order to derive how much each account has (i.e their balance). </p>
  
  <p>I want this to be scalable (ie. 1 billion transactions) so don't want to have to perform database hits to the main fact table as it will need to find all the debits/credits associated with a desired account number scanning potentially a billion rows.</p>
  
  <p>Thanks, any help or resources would be awesome.</p>