Berkeley DB Reference Guide: Base replication API
Description: Berkeley DB: An embedded database programmatic toolkit.
Keywords: embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++

### Berkeley DB Reference Guide: Berkeley DB Replication |

### Base replication API

Applications which use the Base replication API use the following Berkeley DB methods.

DB_ENV->rep_set_transport
  The DB_ENV->rep_set_transport method configures the replication system's communications infrastructure.
DB_ENV->rep_start
  The DB_ENV->rep_start method configures (or reconfigures) an existing database environment to be a replication master or client.
DB_ENV->rep_process_message
  The DB_ENV->rep_process_message method is used to process incoming messages from other environments in the replication group. For clients, it is responsible for accepting log records and updating the local databases based on messages from the master. For both the master and the clients, it is responsible for handling administrative functions (for example, the protocol for dealing with lost messages), and permitting new clients to join an active replication group. This method should only be called after the environment has been configured as a replication master or client via DB_ENV->rep_start.
DB_ENV->rep_elect
  The DB_ENV->rep_elect method causes the replication group to elect a new master; it is called whenever contact with the master is lost and the application wants the remaining sites to select a new master.
DB_ENV->set_event_notify
  The DB_ENV->set_event_notify method is needed for applications to discover important replication-related events, such as the result of an election and appointment of a new master.
DB_ENV->rep_set_priority
  The DB_ENV->rep_set_priority method configures the local site's priority for the purpose of elections.
DB_ENV->rep_set_timeout
  Note that of all the various timeouts this method can set, only DB_REP_ELECTION_TIMEOUT is relevant for applications which use the Base replication API. The others are used only by Replication Manager.
DB_ENV->rep_set_limit
  The DB_ENV->rep_set_limit method imposes an upper bound on the amount of data that will be sent in response to a single call to DB_ENV->rep_process_message. During client recovery, that is, when a replica site is trying to synchronize with the master, clients may ask the master for a large number of log records. If it is going to harm an application for the master message loop to remain busy for an extended period transmitting records to the replica, then the application will want to use DB_ENV->rep_set_limit to limit the amount of data the master will send before relinquishing control and accepting other messages.

In addition to the methods previously described, applications which use the Base replication API may also call the following methods, as needed: DB_ENV->rep_stat, DB_ENV->rep_sync, DB_ENV->rep_set_config.

Copyright (c) 1996,2007 Oracle. All rights reserved.