1<!--$Id: why.so,v 1.7 2003/11/04 14:53:27 bostic Exp $-->
2<!--Copyright (c) 1997,2008 Oracle.  All rights reserved.-->
3<!--See the file LICENSE for redistribution information.-->
4<html>
5<head>
6<title>Berkeley DB Reference Guide: Why transactions?</title>
7<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
8<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++">
9</head>
10<body bgcolor=white>
11<table width="100%"><tr valign=top>
12<td><b><dl><dt>Berkeley DB Reference Guide:<dd>Berkeley DB Transactional Data Store Applications</dl></b></td>
13<td align=right><a href="/transapp/intro.html"><img src="/images/prev.gif" alt="Prev"></a><a href="/toc.html"><img src="/images/ref.gif" alt="Ref"></a><a href="/transapp/term.html"><img src="/images/next.gif" alt="Next"></a>
14</td></tr></table>
15<p align=center><b>Why transactions?</b></p>
16<p>Perhaps the first question to answer is "Why transactions?"  There are
17a number of reasons to include transactional support in your applications.
18The most common ones are the following:</p>
19<br>
20<b>Recoverability</b><ul compact><li>Applications often need to ensure that no matter how the system or
21application fails, previously saved data is available the next time the
22application runs.  This is often called Durability.</ul>
23<b>Atomicity</b><ul compact><li>Applications may need to make multiple changes to one or more databases,
24but ensure that either all of the changes happen, or none of them
25happens.  Transactions guarantee that a group of changes are atomic;
26that is, if the application or system fails, either all of the changes
27to the databases will appear when the application next runs, or none of
28them.</ul>
29<b>Isolation</b><ul compact><li>Applications may need to make changes in isolation, that is, ensure that
30only a single thread of control is modifying a key/data pair at a time.
31Transactions ensure each thread of control sees all records as if all
32other transactions either completed before or after its transaction.</ul>
33<br>
34<table width="100%"><tr><td><br></td><td align=right><a href="/transapp/intro.html"><img src="/images/prev.gif" alt="Prev"></a><a href="/toc.html"><img src="/images/ref.gif" alt="Ref"></a><a href="/transapp/term.html"><img src="/images/next.gif" alt="Next"></a>
35</td></tr></table>
36<p><font size=1>Copyright (c) 1996,2008 Oracle.  All rights reserved.</font>
37</body>
38</html>
39