1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml">
4  <head>
5    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6    <title>Replication Benefits</title>
7    <link rel="stylesheet" href="gettingStarted.css" type="text/css" />
8    <meta name="generator" content="DocBook XSL Stylesheets V1.62.4" />
9    <link rel="home" href="index.html" title="Getting Started with Replicated Berkeley DB Applications" />
10    <link rel="up" href="introduction.html" title="Chapter��1.��Introduction" />
11    <link rel="previous" href="introduction.html" title="Chapter��1.��Introduction" />
12    <link rel="next" href="apioverview.html" title="The Replication APIs" />
13  </head>
14  <body>
15    <div class="navheader">
16      <table width="100%" summary="Navigation header">
17        <tr>
18          <th colspan="3" align="center">Replication Benefits</th>
19        </tr>
20        <tr>
21          <td width="20%" align="left"><a accesskey="p" href="introduction.html">Prev</a>��</td>
22          <th width="60%" align="center">Chapter��1.��Introduction</th>
23          <td width="20%" align="right">��<a accesskey="n" href="apioverview.html">Next</a></td>
24        </tr>
25      </table>
26      <hr />
27    </div>
28    <div class="sect1" lang="en" xml:lang="en">
29      <div class="titlepage">
30        <div>
31          <div>
32            <h2 class="title" style="clear: both"><a id="repadvantage"></a>Replication Benefits</h2>
33          </div>
34        </div>
35        <div></div>
36      </div>
37      <p>
38
39            Replication offers your application a number of benefits that
40            can be a tremendous help. Primarily replication's benefits
41            revolve around performance, but there is also a benefit in
42            terms of data durability guarantees.
43        </p>
44      <p>
45            Briefly, the reasons why you might choose to implement
46            replication in your DB application are:
47        </p>
48      <div class="itemizedlist">
49        <div class="itemizedlist">
50          <ul type="circle">
51            <li>
52              <p>
53                                   Improved application reliability.
54                           </p>
55              <p>
56                                   By spreading your data across multiple
57                                   machines, you can ensure that your
58                                   application's data continues to be
59                                   available even in the event of a
60                                   hardware failure on any given machine in
61                                   the replication group.
62                           </p>
63            </li>
64          </ul>
65        </div>
66        <ul type="disc">
67          <li>
68            <p>
69                    Improve read performance.
70                </p>
71            <p>
72                    By using replication you can spread data reads across
73                    multiple machines on your network. Doing so allows you
74                    to vastly improve your application's read performance.
75                    This strategy might be particularly interesting for
76                    applications that have readers on remote network nodes;
77                    you can push your data to the network's edges thereby
78                    improving application data read responsiveness.
79                </p>
80            <p>
81                        Additionally, depending on how you partition your
82                        data across your replicas, any given replica may
83                        only need to cache part of your data, decreasing
84                        cache misses and reducing I/O on the client.
85                </p>
86          </li>
87          <li>
88            <p>
89                   Improve transactional commit performance
90                </p>
91            <p>
92                   In order to commit a transaction and achieve a
93                   transactional durability guarantee, the commit must be
94                   made <span class="emphasis"><em>durable</em></span>. That is, the commit
95                   must be written to disk (usually, but not always,
96                   synchronously) before the application's thread of
97                   control can continue operations.
98                </p>
99            <p>
100                    Replication allows you to avoid this disk I/O and still
101                    maintain a degree of durability by <span class="emphasis"><em>committing
102                    to the network</em></span>. In other words, you relax
103                    your transactional durability guarantees on the master,
104                    but by virtue of replicating the data across the
105                    network you gain some additional durability guarantees
106                    above what is provided locally. 
107                </p>
108            <p>
109                    Usually this strategy is implemented using some form of
110                    an asynchronous transactional commit on the master.  In
111                    this way your data writes will eventually be written to
112                    disk, but your application will not have to wait for
113                    the disk I/O to complete before continuing with its
114                    next operation.
115                </p>
116            <p>
117                    Note that it is possible to cause DB's replication
118                    implementation to wait to hear from one or
119                    more replica's as to whether they have successfully
120                    saved the write before continuing. However, in this
121                    case you might be trading performance for a even
122                    higher durability guarantee (see below).
123                </p>
124          </li>
125          <li>
126            <p>
127                   Improve data durability guarantee.        
128                </p>
129            <p>
130                    In a traditional transactional application, you commit your
131                    transactions such that data modifications are saved to
132                    disk. Beyond this, the durability of your data is
133                    dependent upon the backup strategy that you choose to
134                    implement for your site.
135                </p>
136            <p>
137                    Replication allows you to increase this durability
138                    guarantee by ensuring that data modifications are
139                    written to multiple machines. This means that multiple
140                    disks, disk controllers, power supplies, and CPUs are
141                    used to ensure that your data modification makes it to
142                    stable storage. In other words, replication allows you
143                    to minimize the problem of a single point of failure
144                    by using more hardware to guarantee your data writes.
145                </p>
146            <p>
147                    If you are using replication for this reason, then you
148                    probably will want to configure your application such
149                    that it waits to hear about a successful commit from 
150                    one or more replicas before continuing with the next
151                    operation. This will obviously impact your
152                    application's write performance to some degree 
153                    ��� with the performance penalty being largely dependent
154                    upon the speed and stability of the network connecting
155                    your replication group.
156                </p>
157            <p>
158                        For more information, see <a href="fwrkpermmessage.html">Permanent Message Handling</a>.
159                </p>
160          </li>
161        </ul>
162      </div>
163    </div>
164    <div class="navfooter">
165      <hr />
166      <table width="100%" summary="Navigation footer">
167        <tr>
168          <td width="40%" align="left"><a accesskey="p" href="introduction.html">Prev</a>��</td>
169          <td width="20%" align="center">
170            <a accesskey="u" href="introduction.html">Up</a>
171          </td>
172          <td width="40%" align="right">��<a accesskey="n" href="apioverview.html">Next</a></td>
173        </tr>
174        <tr>
175          <td width="40%" align="left" valign="top">Chapter��1.��Introduction��</td>
176          <td width="20%" align="center">
177            <a accesskey="h" href="index.html">Home</a>
178          </td>
179          <td width="40%" align="right" valign="top">��The Replication APIs</td>
180        </tr>
181      </table>
182    </div>
183  </body>
184</html>
185