Where should I use connected architecture approach?

Technology CommunityCategory: ADO.NETWhere should I use connected architecture approach?
VietMX Staff asked 3 years ago

I would choose connected Data Access i.e Data Reader for below points.

  • Data Readers are a good choice when an application has to be sensitive to changes in the underlying database
  • The connected Approach (Data Reader) is a better choice for applications that require optimized read-only and forward-only access to data such as binding to a Data Grid control. The sooner the data is off-loaded from the Data Reader and the connection is closed the better the application performance.
  • A Data Reader can be the right choice, such as when populating a list or retrieving 10,000 records for a business rule. When a huge amount of data must be retrieved to a business process, even on a middle tier, it can take a while to load a DataSet, pass the data to it on the business tier from the database, and then store it in memory. The footprint could be quite large and with numerous instances of it running (such as in a Web application where hundreds of users may be connected), scalability would become a problem. If this data is intended to be retrieved and then traversed for business rule processing, the DataReader could speed up the process as it retrieves one row at a time and does not require the memory resources that the DataSet requires.