Remote Data Access Architecture

Remote data access (RDA) uses three components of Microsoft SQL Server Compact 3.5 (SQL Server Compact 3.5): the SQL Server Compact 3.5 Database Engine, the SQL Server Compact 3.5 Client Agent, and the SQL Server Compact 3.5 Server Agent.

RDA uses Microsoft Internet Information Services (IIS) as the communication mechanism between the SQL Server database on a server and the SQL Server Compact 3.5 database on the device. The SQL Server Compact 3.5 Database Engine, the SQL Server Compact 3.5 Client Agent, and the SQL Server Compact 3.5 Server Agent work together to accomplish RDA, as shown in the following diagram.

Remote Data Access (RDA) architecture

SQL Server Compact 3.5 Database Engine

The SQL Server Compact 3.5 Database Engine manages the SQL Server data store on the device. For pull operations that are tracked, the Database Engine tracks all database records that are inserted, updated, or deleted by maintaining a small amount of change tracking information with each record. If indexes exist on the SQL Server data, RDA also supports creating indexes on the local data.

SQL Server Compact 3.5 Client Agent

The SQL Server Compact 3.5 Client Agent, located on the device, is the primary component used for RDA. The Client Agent implements the RDA object interface. Applications call this interface to programmatically control RDA.

The actions that the SQL Server Compact 3.5 Client Agent takes in response to RDA object method calls are described in the following table.

Method Action

Pull

Forwards the request to the SQL Server Compact 3.5 Server Agent through HTTP. When the SQL Server Compact 3.5 Client Agent receives the recordset from SQL Server, it stores the recordset in the SQL Server Compact 3.5 database.

Push

Extracts all inserted, updated, and deleted records from the SQL Server Compact 3.5 database and sends them to the SQL Server Compact 3.5 Server Agent through HTTP.

SubmitSQL

Forwards the specified SQL request to SQL Server Compact 3.5 Server Agent through HTTP.

SQL Server Compact 3.5 Server Agent

The SQL Server Compact 3.5 Server Agent, located on the computer that is running IIS, handles the HTTP requests made by the SQL Server Compact 3.5 Client Agent. It uses temporary message files (*.in and *.out) to manage the exchange of data between SQL Server and SQL Server Compact 3.5.

The actions that the SQL Server Compact 3.5 Server Agent takes in response to RDA object method calls are described in the following table.

Method Action

Pull

Receives the request from the SQL Server Compact 3.5 Client Agent, connects to SQL Server through the OLE DB Provider for SQL Server, and invokes the client's SQL statement. The SQL Server Compact 3.5 Server Agent returns the resulting recordset to the SQL Server Compact 3.5 Client Agent through HTTP.

Push

Receives all the inserted, updated, and deleted records from the SQL Server Compact 3.5 Client Agent, connects to SQL Server through OLE DB, and inserts, updates, or deletes the records in the SQL Server database. If errors occur, the SQL Server Compact 3.5 Server Agent reports the errors to the SQL Server Compact 3.5 Client Agent through HTTP.

SubmitSQL

Receives the specified SQL request from the SQL Server Compact 3.5 Client Agent through HTTP, connects to SQL Server through OLE DB, and invokes the client's SQL statement. If errors occur, the SQL Server Compact 3.5 Server Agent reports the errors to SQL Server Compact 3.5 Client Agent through HTTP.