title: sql stored procedure vs code, which one is better for tremendous amount of data?
body: <p>I am creating an architecture of a web application in MVC, web application will be maintaining data for E-Commerce kind of stuff.A little confusion arises between two approaches,</p>
  <p>1.</p>
  <blockquote>
  <p><strong>Should I keep all code of calculation/Data access in <em>class file(Model)</em></strong> which will be using <strong>EDM</strong> for accessing DATA. This accessed <strong>data thru EDM will be refined</strong> by code available in MODEL file and access by controller. In this approach I will have to <strong>create only few models</strong>, rest models will be created by EDM and can be bound directly to Views.</p>
  </blockquote>
  <ol start="2">
  <li></li>
  </ol>
  <blockquote>
  <p><strong>Should I keep all code of calculation/Data access in <em>Stored procedure</em></strong> which will be using <strong>SQL queries</strong> for accessing DATA. This accessed data thru <strong>SQL queries in stored procedure will be used directly</strong> by code available in MODEL file and access by controller. In this approach I will have to <strong>create many models</strong> as i will have to set parameters of STORED procedure.</p>
  </blockquote>
  <p>Here question arises,</p>
  <ul>
  <li><p>which approach is best for  client , First or second ? and Why ?</p>
  </li>
  <li><p>Will there be any performance difference between these 2 approaches ?
  How ?</p>
  </li>
  <li><p>Which approach will be implemented faster ?</p>
  </li>
  <li><p>Which approach is safer ?</p>
  </li>
  </ul>
  <p>Thank you, in advance.</p>