(Courtesy of Paula Bingham)
Simpler High Availability with Write Forwarding
Do you have a simple Berkeley DB application that would benefit from higher availability or improved read scalability?
These are well-known benefits of using Berkeley DB High Availability (BDB-HA). You can use BDB-HA to turn your application into a distributed application using two or more nodes. One node is the master node on which you can perform read and write operations; the other nodes are replicas which only support read operations. When one node is down, the other nodes keep your application available to users. If you have many read operations, they can be distributed among different nodes.
You might ask "But wait, what if I don't want to restrict write operations to the master node?" and "Isn't it complicated to add BDB-HA to an existing application?"
If your application performs its write operations one-per-transaction without using cursors, it is a candidate for the new Replication Manager write forwarding feature. When write forwarding is enabled, these simple write operations can be performed on a replica.
The code changes to add Replication Manager write forwarding to your application are relatively simple and fall into the following major categories:
- Configure and start Replication Manager: You need to explicitly enable write forwarding, configure your nodes, and start Replication Manager.
- Manage database creation: You only need to create your databases on the initial master node. BDB-HA replicates them to the replica nodes.
- Error handling: Minor code changes to handle a few additional BDB-HA errors.
See "Configuring for Write Forwarding" in the Berkeley DB documentation for more information and sample code illustrating these points.