Consumers and Providers

A consumer is any piece of system or application code that consumes an OLE DB interface. This includes OLE DB components themselves. A provider is any software component that exposes an OLE DB interface.

OLE DB providers can be classified broadly into two classes. A data provider is any OLE DB provider that owns data and exposes its data in a tabular form as a rowset, which is defined later in this chapter. Examples of data providers include relational DBMSs, storage managers, spreadsheets, ISAMs, and e-mail.

A service component (also referred to as a service component) is any OLE DB component that does not own its own data, but encapsulates some service by producing and consuming data through OLE DB interfaces. A service component is both a consumer and a provider. For example, a heterogeneous query processor is a service component. Suppose a consumer asks to join data from tables in two different data sources. In its role as a consumer, the query processor retrieves rows from rowsets created over each of the base tables. In its role as a provider, the query processor creates a rowset from these rows and returns it to the consumer.

Component DBMSs offer greater efficiency than traditional DBMSs because consumers generally require only a portion of the database management functionality offered, thereby reducing resource overhead. OLE DB allows simple tabular data provides to implement functionality native to their data store: at a minimum, they can use only the interfaces that expose data as tables. This opens the opportunity for the development of query processor components, such as SQL or geographical query processors, which can consume tabular information from any provider that exposes its data through OLE DB. In addition, SQL DBMSs can expose their functionality in a more layered manner by using the OLE DB interfaces.

The following section describes the architecture and main interface areas of OLE DB.