Debian Codegraph @

docs/gsg_txn/CXX/sysfailure.html

raw
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>A Note on System Failure</title>
7 <link rel="stylesheet" href="gettingStarted.css" type="text/css" />
8 <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
9 <link rel="start" href="index.html" title="Getting Started with Berkeley DB Transaction Processing" />
10 <link rel="up" href="introduction.html" title="Chapter 1. Introduction" />
11 <link rel="prev" href="introduction.html" title="Chapter 1. Introduction" />
12 <link rel="next" href="apireq.html" title="Application Requirements" />
13 </head>
14 <body>
15 <div xmlns="" class="navheader">
16 <div class="libver">
17 <p>Library Version 11.2.5.3</p>
18 </div>
19 <table width="100%" summary="Navigation header">
20 <tr>
21 <th colspan="3" align="center">A Note on System Failure</th>
22 </tr>
23 <tr>
24 <td width="20%" align="left"><a accesskey="p" href="introduction.html">Prev</a> </td>
25 <th width="60%" align="center">Chapter 1. Introduction</th>
26 <td width="20%" align="right"> <a accesskey="n" href="apireq.html">Next</a></td>
27 </tr>
28 </table>
29 <hr />
30 </div>
31 <div class="sect1" lang="en" xml:lang="en">
32 <div class="titlepage">
33 <div>
34 <div>
35 <h2 class="title" style="clear: both"><a id="sysfailure"></a>A Note on System Failure</h2>
36 </div>
37 </div>
38 </div>
39 <p>
40 From time to time this manual mentions that transactions
41 protect your data against 'system or application failure.' This
42 is true up to a certain extent. However, not all failures are
43 created equal and no data protection mechanism can protect you
44 against every conceivable way a computing system can find to
45 die.
46 </p>
47 <p>
48 Generally, when this book talks about protection against
49 failures, it means that transactions offer protection against
50 the likeliest culprits for system and application crashes. So
51 long as your data modifications have been committed to disk,
52 those modifications should persist even if your application or
53 OS subsequently fails. And, even if the application or OS
54 fails in the middle of a transaction commit (or abort), the
55 data on disk should be either in a consistent state, or there
56 should be enough data available to bring your databases into a
57 consistent state (via a recovery procedure, for example). You
58 may, however, lose whatever data you were committing at the
59 time of the failure, but your databases will be otherwise
60 unaffected.
61 </p>
62 <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
63 <h3 class="title">Note</h3>
64 <p>
65 Be aware that many disks have a disk write cache and on
66 some systems it is enabled by default. This means that
67 a transaction can have committed, and to your
68 application the data may appear to reside on disk, but
69 the data may in fact reside only in the write cache at
70 that time. This means that if the disk write cache is
71 enabled and there is no battery backup for it, data can
72 be lost after an OS crash even when maximum durability
73 mode is in use. For maximum durability, disable the
74 disk write cache or use a disk write cache with a
75 battery backup.
76 </p>
77 </div>
78 <p>
79 Of course, if your <span class="emphasis"><em>disk</em></span> fails, then the transactional benefits described in this book
80 are only as good as the backups you have taken.
81
82
83 <span>
84 By spreading your data and log files across separate disks,
85 you can minimize the risk of data loss due to a disk
86 failure, but even in this case it is possible to conjure a
87 scenario where even this protection is insufficient (a fire
88 in the machine room, for example) and you must go to your
89 backups for protection.
90 </span>
91 </p>
92 <p>
93 Finally, by following the programming examples shown in this book, you can write your code so as to protect
94 your data in the event that your code crashes. However, no programming API can protect you against logic
95 failures in your own code; transactions cannot protect you from simply writing the wrong thing to your
96 databases.
97 </p>
98 </div>
99 <div class="navfooter">
100 <hr />
101 <table width="100%" summary="Navigation footer">
102 <tr>
103 <td width="40%" align="left"><a accesskey="p" href="introduction.html">Prev</a> </td>
104 <td width="20%" align="center">
105 <a accesskey="u" href="introduction.html">Up</a>
106 </td>
107 <td width="40%" align="right"> <a accesskey="n" href="apireq.html">Next</a></td>
108 </tr>
109 <tr>
110 <td width="40%" align="left" valign="top">Chapter 1. Introduction </td>
111 <td width="20%" align="center">
112 <a accesskey="h" href="index.html">Home</a>
113 </td>
114 <td width="40%" align="right" valign="top"> Application Requirements</td>
115 </tr>
116 </table>
117 </div>
118 </body>
119 </html>