Monday, October 20, 2008

DAO, RDO and ADO - A comparison

DAO (Data Access Objects) could be considered to be the first data access model from Microsoft, by passing the common programmming targetting their Jet Engine. It could connect to any of the local Microsoft datastores supported by Jet Engine. The first version of DAO came by 1992 and the final version of DAO was 3.6

Next to that, Microsoft developed a new data access model which can connect to the ODBC compatible Remote Servers, called RDO (Remote Data Objects). It was mainly developed for Visual Basic Applications for supporting Rapid Application Development (RAD). RDO is the COM wrapper of ODBC. ODBC, a C-based API, allows general-purpose (heterogeneous) data access. However, RDO relies on SQL as the command language to access data. The main disadvantage of RDO was it supports ODBC compatible DataSources only.

Microsoft developed a new Data Access Model to connect to any of the Data Sources called ActiveX Data Objects (ADO). ADO is a COM wrapper of OLE DB that facilitates writing data access applications (consumers). OLE DB is a COM-based universal data access technology, allowing you to use any data source, not just indexed, sequential access methods (ISAM) and SQL-based databases.OLE DB providers can access data from a variety of data sources and is not limited to SQL queries to retrieve data but rather can use queries as defined in the provider.

The .NET implementation of ADO (ADO.NET) is even powerful than the previous implementation. ADO relies on COM whereas ADO.NET relies on managed-providers defined by the .NET CLR. ADO.NET does not replace ADO for the COM programmer; rather, it provides the .NET programmer with access to relational data sources, XML, and application data. ADO.NET is changed so extensively from ADO that it can be considered an entirely new product.

The major difference with ADO and ADO.NET could be summarized as below

  1. ADO uses connection-oriented models (mostly) where as ADO.NET uses Disconnected Models
  2. Disconnected Access in ADO is by means of RecordSets where as ADO.NET uses Adapter and DataSet
  3. ADO.NET provides robus XML support where as it is considerably limited in ADO
  4. In ADO, the Client application needs to be connected always to data-server while working on the data where as Client disconnected as soon as the data is processed in ADO.NET and the DataSet is disconnected at all times.
  5. ADO objects communicate in binary mode where as ADO.NET uses XML for passing the data
  6. ADO.NET includes some implicit data access behaviors that may not always be required in an application and that may therefore limit performance where as ADO.NET provides well-defined, factored components with predictable behavior, performance, and semantics for data access.
  7. ADO derives information about data implicitly at run time, based on metadata that is often expensive to obtain where as ADO.NET leverages known metadata at design time in order to provide better run-time performance and more consistent run-time behavior.

Click here to read the architecture of ADO.NET in MSDN