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