Chapter 1.  Introduction

Table of Contents

Features
Developing a JE Collections Application
Tutorial Introduction

The JE JE Collections API is a Java framework that extends the well known Java Collections design pattern such that collections can now be stored, updated and queried in a transactional manner. The JE JE Collections API is a layer on top of JE.

Together the JE JE Collections API and Berkeley DB Java Edition provide an embedded data management solution with all the benefits of a full transactional storage and the simplicity of a well known Java API. Java programmers who need fast, scalable, transactional data management for their projects can quickly adopt and deploy the JE JE Collections API with confidence.

This framework was first known as Greybird DB written by Mark Hayes. Mark collaborated with us to permanently incorporate his excellent work into our distribution and to support it as an ongoing part of Berkeley DB and Berkeley DB Java Edition. The repository of source code that remains at SourceForge at version 0.9.0 is considered the last version before incorporation and will remain intact but will not be updated to reflect changes made as part of Berkeley DB or Berkeley DB Java Edition.

Features

JE provides a Java API that can be roughly described as a map and cursor interface, where the keys and values are represented as byte arrays. The JE JE Collections API is a layer on top of JE. It adds significant new functionality in several ways.

  • An implementation of the Java Collections interfaces (Map, SortedMap, Set, SortedSet, and Iterator) is provided.

  • Transactions are supported using the conventional Java transaction-per-thread model, where the current transaction is implicitly associated with the current thread.

  • Transaction runner utilities are provided that automatically perform transaction retry and exception handling.

  • Keys and values are represented as Java objects rather than byte arrays. Bindings are used to map between Java objects and the stored byte arrays.

  • The tuple data format is provided as the simplest data representation, and is useful for keys as well as simple compact values.

  • The serial data format is provided for storing arbitrary Java objects without writing custom binding code. Java serialization is extended to store the class descriptions separately, making the data records much more compact than with standard Java serialization.

  • Custom data formats and bindings can be easily added. XML data format and XML bindings could easily be created using this feature, for example.

Note that the JE JE Collections API does not support caching of programming language objects nor does it keep track of their stored status. This is in contrast to "persistent object" approaches such as those defined by ODMG and JDO (JSR 12). Such approaches have benefits but also require sophisticated object caching. For simplicity the JE JE Collections API treats data objects by value, not by reference, and does not perform object caching of any kind. Since the JE JE Collections API is a thin layer, its reliability and performance characteristics are roughly equivalent to those of Berkeley DB, and database tuning is accomplished in the same way as for any Berkeley DB database.