Getting Started with Replicated Berkeley DB Applications

Legal Notice

This documentation is distributed under an open source license. You may review the terms of this license at:

Oracle, Berkeley DB, and Sleepycat are trademarks or registered trademarks of Oracle. All rights to these marks are reserved. No third-party use is permitted without the express prior written consent of Oracle.

Other names may be trademarks of their respective owners.

To obtain a copy of this document's original source code, please submit a request to the Oracle Technology Network forum at:


Table of Contents

Conventions Used in this Book
For More Information
Contact Us
1. Introduction
Replication Environments
Replication Databases
Communications Layer
Selecting a Master
Replication Benefits
The Replication APIs
Replication Manager Overview
Replication Base API Overview
Holding Elections
Influencing Elections
Winning Elections
Switching Masters
Permanent Message Handling
When Not to Manage Permanent Messages
Managing Permanent Messages
Implementing Permanent Message Handling
2. Transactional Application
Application Overview
Program Listing
Function: main()
Function: create_env()
Function: env_init()
Function: doloop()
Function: print_stocks()
3. The DB Replication Manager
The DB_SITE Handle
Starting and Stopping Replication
Managing Election Policies
Selecting the Number of Threads
Adding the Replication Manager to ex_rep_gsg_simple
Permanent Message Handling
Identifying Permanent Message Policies
Setting the Permanent Message Timeout
Adding a Permanent Message Policy to ex_rep_gsg_repmgr
Managing Election Times
Managing Election Timeouts
Managing Election Retry Times
Managing Connection Retries
Managing Heartbeats
4. Replica versus Master Processes
Determining State
Processing Loop
Example Processing Loop
Running It
5. Additional Features
Delayed Synchronization
Managing Blocking Operations
Stop Auto-Initialization
Read-Your-Writes Consistency
Client to Client Transfer
Identifying Peers
Bulk Transfers