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