title: Entity Framework, WCF, Clients, and Object Context questions
body: <p><strong>Application purpose:</strong>
  <br>The application I am creating will be responsible for many processes, but I am currently building a price feeder, a way to save these prices, and functionality to send these prices to a client application (as a proof of concept). These prices will be mapped to entities called "Security Analytics" and "Security Price Log". These two entities have the same properties, but the log keeps record of each price received, where analytics simply holds the most recent data for each security.</p>
  
  <p>I am currently trying to determine the most effecient and stable way of completing this. The requirements/obstables of this are:</p>
  
  <ul>
  <li>Prices come in very frequently (will sometimes receive multiple prices every second)</li>
  <li>Client's require realtime data</li>
  <li>Prices need to be persisted to the database each time they come in </li>
  </ul>
  
  <p><strong>Architecture:</strong>
  <br>I belieive this application is suited towards an n-tier architecture. The layers I am thinking of including are (pardon my naming of these):</p>
  
  <ul>
  <li><strong>Entity layer:</strong> where model is constructed</li>
  <li><strong>"Factory":</strong> this will contain my feeds (there will be approximately 10), logic for processing data, conversion of data to entities, and allow for exposure of data to clients</li>
  <li><strong>Client layer:</strong> I want to the factory to expose data contracts to allow clients to consume the real time data within the factory. I done some research and I will complete this through WCF web services using a Pub-Sub design pattern</li>
  </ul>
  
  <p>So with all of that background information and rambling here are my questions:</p>
  
  <ul>
  <li>What are the disadvantages to having a long running object context? (I kept reading that I shouldn't do this, but no one explicitly said why or gave alternatives that will work for me)</li>
  <li>If I am constantly creating new contexts, is the data I have pulled into a previous context available in a new context? I am concerned that I will be pulling data from the database too often when I am pushing data to clients and processing many new prices.</li>
  <li>I am currently using self-tracking entities and think they are the correct choice for this application, but if anyone has any concerns or wisdom they could provide, that would be appreciated.</li>
  <li>Lastly, what would be the best type of project for creating my "factory"? It will be running on an IIS server and I would like it to accept all of my data feeds and have clients accepting different and composite (from multiple feeds) data. I am leaning towards a WCF Service Application as it will allow me to easily derive service contracts, but I am not sure if this is the correct choice.</li>
  </ul>
  
  <p>Any help you can provide with this is appreciated. Also, I appologize for the length of this, I am just quite lost as to how the entity framework works and where I should start. Thanks!</p>
  
  <p>EDIT: Thanks for your responses everyone. I have to move onto something else for now, but I will review these later this week when I have a chance.</p>