Berkeley DB Reference Version 5.3.33

Chapter 10.  Replication Methods

This chapter describes the APIs available to build Berkeley DB replicated applications. There are two different ways to build replication into a Berkeley DB application, and the APIs for both are described in this chapter.

For an overview of the two different ways to build a replicated application, see the Berkeley DB Getting Started with Replicated Applications guide.

The first, and simplest, way to build a replication Berkeley DB application is via the Replication Manager. If the Replication Manager does not meet your application's architectural requirements, you can write your own replication implementation using the "Base APIs".

Note that the Replication Manager is written using the Base APIs.

Note, also, that applications which make use of the Replication Manager use many of the Base APIs as the situation warrants. That said, a few Base API methods cannot be used by applications that are making use of the Replication Manager. Where this is the case, this is noted in the following method descriptions.

Finally, Replication Manager applications use the DB_SITE class to manage and configure replication sites. This handle is not used in any way by Base API applications.

Replication Manager Methods Description
DB_CHANNEL->close() Closes a DB_CHANNEL handle
DB_CHANNEL->send_msg() Sends an asynchronous message on a DB_CHANNEL
DB_CHANNEL->send_request() Sends a synchronous message on a DB_CHANNEL
DB_CHANNEL->set_timeout() Sets the default timeout for the DB_CHANNEL
DB_ENV->repmgr_channel() Creates a DB_CHANNEL handle
DB_ENV->repmgr_local_site() Returns a DB_SITE handle for the local site
DB_ENV->repmgr_msg_dispatch() Creates a DB_CHANNEL handle
DB_ENV->repmgr_set_ack_policy(), DB_ENV->repmgr_get_ack_policy() Specify the Replication Manager's client acknowledgement policy
DB_ENV->repmgr_site() Creates a DB_SITE handle
DB_ENV->repmgr_site_by_eid() Creates a DB_SITE handle given an EID value
DB_ENV->repmgr_site_list() List the sites and their status
DB_ENV->repmgr_start() Start the Replication Manager
DB_ENV->repmgr_stat() Replication Manager statistics
DB_ENV->repmgr_stat_print() Print Replication Manager statistics
Base API Methods
DB_ENV->rep_elect() Hold a replication election
DB_ENV->rep_process_message() Process a replication message
DB_ENV->rep_set_transport() Configure replication transport callback
DB_ENV->rep_start() Start replication
Additional Replication Methods
DB_ENV->rep_stat() Replication statistics
DB_ENV->rep_stat_print() Print replication statistics
DB_ENV->rep_sync() Replication synchronization
DB_ENV->txn_applied() Check if a transaction has been replicated
Replication Configuration
DB_SITE->close() Closes the DB_SITE handle
DB_SITE->get_address() Returns a site's network address
DB_SITE->get_eid() Returns a site's Environment ID
DB_SITE->remove() Removes the site from the replication group
DB_SITE->set_config(), DB_SITE->get_config() Configure a DB_SITE handle
DB_ENV->rep_set_clockskew(), DB_ENV->rep_get_clockskew() Configure master lease clock adjustment
DB_ENV->rep_set_config(), DB_ENV->rep_get_config() Configure the replication subsystem
DB_ENV->rep_set_limit(), DB_ENV->rep_get_limit() Limit data sent in response to a single message
DB_ENV->rep_set_nsites(), DB_ENV->rep_get_nsites() Configure replication group site count
DB_ENV->rep_set_priority(), DB_ENV->rep_get_priority() Configure replication site priority
DB_ENV->rep_set_request(), DB_ENV->rep_get_request() Configure replication client retransmission requests
DB_ENV->rep_set_timeout(), DB_ENV->rep_get_timeout() Configure replication timeouts
Transaction Operations
DB_TXN->set_commit_token() Set a commit token