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