| 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</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="Berkeley DB Collections Tutorial" /> |
| 10 |
<link rel="up" href="index.html" title="Berkeley DB Collections Tutorial" /> |
| 11 |
<link rel="prev" href="moreinfo.html" title="For More Information" /> |
| 12 |
<link rel="next" href="developing.html" title="Developing a DB Collections Application" /> |
| 13 |
</head> |
| 14 |
<body> |
| 15 |
<div xmlns="" class="navheader"> |
| 16 |
<div class="libver"> |
| 17 |
<p>Library Version 11.2.5.3</p> |
| 18 |
</div> |
| 19 |
<table width="100%" summary="Navigation header"> |
| 20 |
<tr> |
| 21 |
<th colspan="3" align="center">Chapter 1. |
| 22 |
Introduction |
| 23 |
</th> |
| 24 |
</tr> |
| 25 |
<tr> |
| 26 |
<td width="20%" align="left"><a accesskey="p" href="moreinfo.html">Prev</a> </td> |
| 27 |
<th width="60%" align="center"> </th> |
| 28 |
<td width="20%" align="right"> <a accesskey="n" href="developing.html">Next</a></td> |
| 29 |
</tr> |
| 30 |
</table> |
| 31 |
<hr /> |
| 32 |
</div> |
| 33 |
<div class="chapter" lang="en" xml:lang="en"> |
| 34 |
<div class="titlepage"> |
| 35 |
<div> |
| 36 |
<div> |
| 37 |
<h2 class="title"><a id="intro"></a>Chapter 1. |
| 38 |
Introduction |
| 39 |
</h2> |
| 40 |
</div> |
| 41 |
</div> |
| 42 |
</div> |
| 43 |
<div class="toc"> |
| 44 |
<p> |
| 45 |
<b>Table of Contents</b> |
| 46 |
</p> |
| 47 |
<dl> |
| 48 |
<dt> |
| 49 |
<span class="sect1"> |
| 50 |
<a href="intro.html#features">Features</a> |
| 51 |
</span> |
| 52 |
</dt> |
| 53 |
<dt> |
| 54 |
<span class="sect1"> |
| 55 |
<a href="developing.html">Developing a DB Collections Application</a> |
| 56 |
</span> |
| 57 |
</dt> |
| 58 |
<dt> |
| 59 |
<span class="sect1"> |
| 60 |
<a href="tutorialintroduction.html">Tutorial Introduction</a> |
| 61 |
</span> |
| 62 |
</dt> |
| 63 |
</dl> |
| 64 |
</div> |
| 65 |
<p> |
| 66 |
The DB Java Collections API is a Java framework that extends |
| 67 |
the well known |
| 68 |
<a class="ulink" href="http://download.oracle.com/javase/1.5.0/docs/guide/collections/" target="_top">Java Collections</a> |
| 69 |
design pattern such that collections can now be |
| 70 |
stored, updated and queried in a transactional manner. The |
| 71 |
DB Java Collections API is a layer on top of DB. |
| 72 |
</p> |
| 73 |
<p> |
| 74 |
Together the DB Java Collections API and Berkeley DB provide an |
| 75 |
embedded data management solution with all the benefits of a full |
| 76 |
transactional storage and the simplicity of a well known Java API. |
| 77 |
Java programmers who need fast, scalable, transactional data |
| 78 |
management for their projects can quickly adopt and deploy the |
| 79 |
DB Java Collections API with confidence. |
| 80 |
</p> |
| 81 |
<p> |
| 82 |
This framework was first known as |
| 83 |
<a class="ulink" href="http://greybird-db.sourceforge.net/" target="_top">Greybird DB</a> |
| 84 |
written by Mark Hayes. Mark collaborated with us to |
| 85 |
permanently incorporate his excellent work into our distribution |
| 86 |
and to support it as an ongoing part of Berkeley DB and Berkeley DB Java |
| 87 |
Edition. The repository of source code that remains at SourceForge at version 0.9.0 is |
| 88 |
considered the last version before incorporation and will remain |
| 89 |
intact but will not be updated to reflect changes made as part of |
| 90 |
Berkeley DB or Berkeley DB Java Edition. |
| 91 |
</p> |
| 92 |
<div class="sect1" lang="en" xml:lang="en"> |
| 93 |
<div class="titlepage"> |
| 94 |
<div> |
| 95 |
<div> |
| 96 |
<h2 class="title" style="clear: both"><a id="features"></a>Features</h2> |
| 97 |
</div> |
| 98 |
</div> |
| 99 |
</div> |
| 100 |
<p> |
| 101 |
<span>Berkeley DB has always provided a Java API which can be roughly |
| 102 |
described as a map and cursor interface, where the keys and values |
| 103 |
are represented as byte arrays. This API is a Java (JNI) interface |
| 104 |
to the C API and it closely modeled the Berkeley DB C API's |
| 105 |
interface.</span> |
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
The DB Java Collections API is a layer on top of |
| 110 |
|
| 111 |
<span>that |
| 112 |
thin JNI mapping of the C API to Berkeley DB.</span> |
| 113 |
|
| 114 |
|
| 115 |
It adds significant new functionality in several ways. |
| 116 |
</p> |
| 117 |
<div class="itemizedlist"> |
| 118 |
<ul type="disc"> |
| 119 |
<li> |
| 120 |
<p> |
| 121 |
An implementation of the Java Collections interfaces (Map, |
| 122 |
SortedMap, Set, SortedSet, |
| 123 |
<span>List</span> |
| 124 |
and Iterator) is provided. |
| 125 |
</p> |
| 126 |
</li> |
| 127 |
<li> |
| 128 |
<p> |
| 129 |
Transactions are supported using the conventional Java |
| 130 |
transaction-per-thread model, where the current transaction is |
| 131 |
implicitly associated with the current thread. |
| 132 |
</p> |
| 133 |
</li> |
| 134 |
<li> |
| 135 |
<p> |
| 136 |
Transaction runner utilities are provided that automatically |
| 137 |
perform transaction retry and exception handling. |
| 138 |
</p> |
| 139 |
</li> |
| 140 |
<li> |
| 141 |
<p> |
| 142 |
Keys and values are represented as Java objects rather than |
| 143 |
byte arrays. Bindings are used to map between Java objects and the |
| 144 |
stored byte arrays. |
| 145 |
</p> |
| 146 |
</li> |
| 147 |
<li> |
| 148 |
<p> |
| 149 |
The tuple data format is provided as the simplest data |
| 150 |
representation, and is useful for keys as well as simple compact |
| 151 |
values. |
| 152 |
</p> |
| 153 |
</li> |
| 154 |
<li> |
| 155 |
<p> |
| 156 |
The serial data format is provided for storing arbitrary Java |
| 157 |
objects without writing custom binding code. Java serialization is |
| 158 |
extended to store the class descriptions separately, making the |
| 159 |
data records much more compact than with standard Java |
| 160 |
serialization. |
| 161 |
</p> |
| 162 |
</li> |
| 163 |
<li> |
| 164 |
<p> |
| 165 |
Custom data formats and bindings can be easily added. XML data |
| 166 |
format and XML bindings could easily be created using this feature, |
| 167 |
for example. |
| 168 |
</p> |
| 169 |
</li> |
| 170 |
<li> |
| 171 |
<p> |
| 172 |
The DB Java Collections API insulates the application |
| 173 |
from minor differences in the use of the Berkeley DB Data Store, |
| 174 |
Concurrent Data Store, and Transactional Data Store products. |
| 175 |
This allows for development with one and deployment with another |
| 176 |
without significant changes to code. |
| 177 |
</p> |
| 178 |
</li> |
| 179 |
</ul> |
| 180 |
</div> |
| 181 |
<p> |
| 182 |
Note that the DB Java Collections API does not support caching |
| 183 |
of programming language objects nor does it keep track of their stored |
| 184 |
status. This is in contrast to "persistent object" approaches such |
| 185 |
as those defined by |
| 186 |
<a class="ulink" href="http://www.odmg.org/odmg.html" target="_top">ODMG</a> |
| 187 |
and JDO |
| 188 |
(<a class="ulink" href="http://www.jcp.org/en/jsr/detail?id=12" target="_top">JSR 12</a>). |
| 189 |
Such approaches have benefits but also require sophisticated object |
| 190 |
caching. For simplicity the DB Java Collections API treats data |
| 191 |
objects by value, not by reference, and does not perform object |
| 192 |
caching of any kind. Since the DB Java Collections API is a thin |
| 193 |
layer, its reliability and performance characteristics are roughly |
| 194 |
equivalent to those of Berkeley DB, and database tuning is |
| 195 |
accomplished in the same way as for any Berkeley DB database. |
| 196 |
</p> |
| 197 |
</div> |
| 198 |
</div> |
| 199 |
<div class="navfooter"> |
| 200 |
<hr /> |
| 201 |
<table width="100%" summary="Navigation footer"> |
| 202 |
<tr> |
| 203 |
<td width="40%" align="left"><a accesskey="p" href="moreinfo.html">Prev</a> </td> |
| 204 |
<td width="20%" align="center"> </td> |
| 205 |
<td width="40%" align="right"> <a accesskey="n" href="developing.html">Next</a></td> |
| 206 |
</tr> |
| 207 |
<tr> |
| 208 |
<td width="40%" align="left" valign="top">For More Information </td> |
| 209 |
<td width="20%" align="center"> |
| 210 |
<a accesskey="h" href="index.html">Home</a> |
| 211 |
</td> |
| 212 |
<td width="40%" align="right" valign="top"> Developing a DB Collections Application</td> |
| 213 |
</tr> |
| 214 |
</table> |
| 215 |
</div> |
| 216 |
</body> |
| 217 |
</html> |