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>Chapter��1.��Introduction to Berkeley DB</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" /> 10 <link rel="up" href="index.html" title="Getting Started with Berkeley DB" /> 11 <link rel="prev" href="preface.html" title="Preface" /> 12 <link rel="next" href="concepts.html" title="Berkeley DB Concepts" /> 13 </head> 14 <body> 15 <div class="navheader"> 16 <table width="100%" summary="Navigation header"> 17 <tr> 18 <th colspan="3" align="center">Chapter��1.��Introduction to Berkeley DB </th> 19 </tr> 20 <tr> 21 <td width="20%" align="left"><a accesskey="p" href="preface.html">Prev</a>��</td> 22 <th width="60%" align="center">��</th> 23 <td width="20%" align="right">��<a accesskey="n" href="concepts.html">Next</a></td> 24 </tr> 25 </table> 26 <hr /> 27 </div> 28 <div class="chapter" lang="en" xml:lang="en"> 29 <div class="titlepage"> 30 <div> 31 <div> 32 <h2 class="title"><a id="introduction"></a>Chapter��1.��Introduction to Berkeley DB </h2> 33 </div> 34 </div> 35 </div> 36 <div class="toc"> 37 <p> 38 <b>Table of Contents</b> 39 </p> 40 <dl> 41 <dt> 42 <span class="sect1"> 43 <a href="introduction.html#aboutthismanual">About This Manual</a> 44 </span> 45 </dt> 46 <dt> 47 <span class="sect1"> 48 <a href="concepts.html">Berkeley DB Concepts</a> 49 </span> 50 </dt> 51 <dt> 52 <span class="sect1"> 53 <a href="accessmethods.html">Access Methods</a> 54 </span> 55 </dt> 56 <dd> 57 <dl> 58 <dt> 59 <span class="sect2"> 60 <a href="accessmethods.html#selectAM">Selecting Access Methods</a> 61 </span> 62 </dt> 63 <dt> 64 <span class="sect2"> 65 <a href="accessmethods.html#BTreeVSHash">Choosing between BTree and Hash</a> 66 </span> 67 </dt> 68 <dt> 69 <span class="sect2"> 70 <a href="accessmethods.html#QueueVSRecno">Choosing between Queue and Recno</a> 71 </span> 72 </dt> 73 </dl> 74 </dd> 75 <dt> 76 <span class="sect1"> 77 <a href="databaseLimits.html">Database Limits and Portability</a> 78 </span> 79 </dt> 80 <dt> 81 <span class="sect1"> 82 <a href="environments.html">Environments</a> 83 </span> 84 </dt> 85 <dt> 86 <span class="sect1"> 87 <a href="coreExceptions.html">Exception Handling</a> 88 </span> 89 </dt> 90 <dt> 91 <span class="sect1"> 92 <a href="returns.html">Error Returns</a> 93 </span> 94 </dt> 95 <dt> 96 <span class="sect1"> 97 <a href="gettingit.html">Getting and Using DB </a> 98 </span> 99 </dt> 100 </dl> 101 </div> 102 <p> 103 Welcome to Berkeley DB (DB). DB is a general-purpose embedded 104 database engine that is capable of providing a wealth of data management services. 105 It is designed from the ground up for high-throughput applications requiring 106 in-process, bullet-proof management of mission-critical data. DB can 107 gracefully scale from managing a few bytes to terabytes of data. For the most 108 part, DB is limited only by your system's available physical resources. 109 </p> 110 <p> 111 You use DB through a series of programming APIs which give you the 112 ability to read and write your data, manage your database(s), and 113 perform other more advanced activities such as managing 114 transactions. 115 116 </p> 117 <p> 118 Because DB is an embedded database engine, it is extremely fast. You compile 119 and link it into your application in the same way as you would any 120 third-party library. This means that DB runs in the same process space 121 as does your application, allowing you to avoid the high cost of 122 interprocess communications incurred by stand-alone database servers. 123 </p> 124 <p> 125 To further improve performance, DB offers an in-memory cache designed to 126 provide rapid access to your most frequently used data. Once configured, 127 cache usage is transparent. It requires very little attention on the part 128 of the application developer. 129 </p> 130 <p> 131 Beyond raw speed, DB is also extremely configurable. It provides several 132 different ways of organizing your data in its databases. Known as 133 <span class="emphasis"><em>access methods</em></span>, each such data organization mechanism 134 provides different characteristics that are appropriate for different data 135 management profiles. (Note that this manual focuses almost entirely on the 136 BTree access method as this is the access method used by the vast majority 137 of DB applications). 138 </p> 139 <p> 140 To further improve its configurability, DB offers many different 141 subsystems, each of which can be used to extend DB's capabilities. For 142 example, many applications require write-protection of their data so 143 as to ensure that data is never left in an inconsistent state for any 144 reason (such as software bugs or hardware failures). For those 145 applications, a transaction subsystem can be enabled and used to 146 transactional-protect database writes. 147 </p> 148 <p> 149 The list of operating systems on which DB is available is too long to 150 detail here. Suffice to say that it is available on all major commercial 151 operating systems, as well as on many embedded platforms. 152 </p> 153 <p> 154 Finally, DB is available in a wealth of programming languages. 155 DB is officially supported in C, C++, and Java, but the library is also 156 available in many other languages, especially scripting languages such as 157 Perl and Python. 158 </p> 159 <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"> 160 <h3 class="title">Note</h3> 161 <p> 162 Before going any further, it is important to mention that DB is not 163 a relational database (although you could use it to build a relational 164 database). Out of the box, DB does not provide higher-level features 165 such as triggers, or a high-level query language such as SQL. 166 Instead, DB provides just those minimal 167 APIs required to store and retrieve your data as 168 efficiently as possible. 169 </p> 170 </div> 171 <div class="sect1" lang="en" xml:lang="en"> 172 <div class="titlepage"> 173 <div> 174 <div> 175 <h2 class="title" style="clear: both"><a id="aboutthismanual"></a>About This Manual</h2> 176 </div> 177 </div> 178 </div> 179 <p> 180 This manual introduces DB. As such, this book does not examine 181 intermediate or advanced features such as threaded library usage or 182 transactional usage. Instead, this manual provides a step-by-step 183 introduction to DB's basic concepts and library usage. 184 </p> 185 <p> 186 Specifically, this manual introduces DB environments, databases, 187 database records, and storage and retrieval of database records. This 188 book also introduces cursors and their usage, and it describes 189 secondary databases. 190 </p> 191 <p> 192 For the most part, this manual focuses on the BTree access method. A 193 chapter is given at the end of this manual that describes some of the 194 concepts involving BTree usage, such as duplicate record management and comparison 195 routines. 196 </p> 197 <p> 198 Examples are given throughout this book that are designed to illustrate 199 API usage. At the end of each 200 <span>chapter,</span> 201 202 a complete example is given that 203 is designed to reinforce the concepts covered in that 204 <span>chapter.</span> 205 206 In addition to being presented in this book, these final programs are also 207 available in the DB software distribution. You can find them in 208 </p> 209 <pre class="programlisting"><span class="emphasis"><em>DB_INSTALL</em></span>/examples_cxx/getting_started</pre> 210 <p> 211 where <code class="literal"><span class="emphasis"><em>DB_INSTALL</em></span></code> is the 212 location where you placed your DB distribution. 213 </p> 214 <p> 215 This book uses the C++ programming languages for its examples. 216 Note that versions of this book exist for the C and Java languages as 217 well. 218 </p> 219 </div> 220 </div> 221 <div class="navfooter"> 222 <hr /> 223 <table width="100%" summary="Navigation footer"> 224 <tr> 225 <td width="40%" align="left"><a accesskey="p" href="preface.html">Prev</a>��</td> 226 <td width="20%" align="center">��</td> 227 <td width="40%" align="right">��<a accesskey="n" href="concepts.html">Next</a></td> 228 </tr> 229 <tr> 230 <td width="40%" align="left" valign="top">Preface��</td> 231 <td width="20%" align="center"> 232 <a accesskey="h" href="index.html">Home</a> 233 </td> 234 <td width="40%" align="right" valign="top">��Berkeley DB Concepts</td> 235 </tr> 236 </table> 237 </div> 238 </body> 239</html> 240