Home | Previous Page | Next Page   Fault Tolerance > High-Availability Data Replication (Enterprise/Workgroup Editions) > Designing HDR Clients >

Designing Clients to Use the Secondary Database Server

To achieve a degree of load balancing when you use data replication, have some client applications use the secondary database server in a data-replication pair. Design all client applications that use the secondary database server with the following points in mind:

The following sections discuss these considerations in more detail.

No Data Modification Statements

SQL statements that update dbspaces in logical-recovery mode on the secondary database server are not allowed. For example, the ALTER FRAGMENT and CREATE DATABASE statements would produce errors. For a complete list of data modification statements, see the IBM Informix Guide to SQL: Syntax.

To prevent clients that are using the secondary database server from issuing updating statements, you can take either of the following actions:

To make statements that perform an update conditional, make sure that client applications test slqwarn6 of the sqlwarn field in the ESQL/C sqlca structure (and equivalent values for other SQL APIs). The database server sets slqwarn6 to W when it runs as a secondary database server.

Locking and Isolation Level

Because all clients that use the secondary database server only read data, locking to ensure isolation between those clients is not required. However, a client that uses the secondary database server is not protected from the activity of users on the primary database server because the logrecvr threads that perform logical recovery do not use locking.

For example, if a client connected to the secondary database server reads a row, nothing prevents a user on the primary database server from updating that row, even if the client connected to the secondary database server has issued a SET ISOLATION TO REPEATABLE READ statement. The update is reflected on the secondary database server as the logical-log records for the committed transaction are processed. Thus, all queries on the secondary database server are essentially dirty with respect to changes that occur on the primary database server, even though a client that uses the secondary database server might explicitly set the isolation level to something other than Dirty Read.

Important:
All queries on the secondary database server are dirty reads. Do not run queries on the secondary database server while log records that contain data definition language (DDL) statements are being replicated and applied on the secondary database server.
To perform DDL operations on the primary database server
  1. Stop all activity (such as transactions) on the secondary database server.
  2. Run the DDL statements on the primary database server.

    For a complete list of DDL statements, see the IBM Informix Guide to SQL: Syntax.

  3. To issue a checkpoint on the primary database server, use the onmode -c command.
  4. Wait for this checkpoint to get replicated on the secondary database server.
  5. Resume activity on the secondary database server.

Use of Temporary Dbspaces for Sorting and Temporary Tables

Even though the secondary database server is in read-only mode, it does write when it needs to perform a sort or create a temporary table. Temporary Dbspaces explains where the database server finds temporary space to use during a sort or for a temporary table. To prevent the secondary database server from writing to a dbspace that is in logical-recovery mode, you must take the following actions:

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]