Berkeley DB

From Wikipedia, the free encyclopedia

Jump to: navigation, search
Berkeley DB
Original author(s) Many developers at Oracle Corporation
Developer(s) Oracle Corporation
Stable release 4.8.24 / 2009-08-14; 3 months ago
Written in C with APIs for most other languages
Operating system Unix, Linux, Windows, AIX, Sun Solaris, SCO Unix, Mac OS
Size ~700KB compiled on x86
Development status production
Type Database
License Sleepycat License
Website www.oracle.com/database/berkeley-db/db/index.html

Berkeley DB (BDB) is a computer software library that provides a high-performance embedded database, with bindings in C, C++, Java, Perl, Python, Ruby, Tcl, Smalltalk, and other programming languages. BDB stores arbitrary key/data pairs as byte arrays, and supports multiple data items for a single key. BDB can support thousands of simultaneous threads of control or concurrent processes manipulating databases as large as 256 terabytes, on a wide variety of operating systems including most Unix-like and Windows systems, and real-time operating systems.

Contents

[edit] Origin

Berkeley DB originated at the University of California, Berkeley as part of the transition (1986 to 1994) from 4.3BSD to 4.4BSD and of the effort to remove AT&T-encumbered code[1]. The first code, due to Seltzer and Yigit[2], attempted to create a disk hash table that performed better than any of the existing Dbm libraries. In 1996 Netscape requested that the authors of Berkeley DB improve and extend the library, then at version 1.86, to suit Netscape's requirements for an LDAP server[3] and for use in the Netscape browser. That request led to the creation of Sleepycat Software. This company was acquired by Oracle Corporation in February 2006, which continues to develop and sell Berkeley DB.

Since its initial release, Berkeley DB has gone through various versions, breaking compatibility (API, ABI and/or file-level) several times. The FreeBSD and OpenBSD operating systems still ship with Berkeley DB 1.8x for compatibility reasons;[4] Linux-based operating systems sometimes ship several versions to accommodate for applications still using older interfaces/files.

Berkeley DB is redistributed under the Sleepycat Public License, which is an OSI-approved open source license as well as an FSF-approved free software licence.[5][6] The product ships with complete source code, build script, test suite, and documentation. The code quality and general utility along with the licensing terms have led to its use in a multitude of free and open source software. Those who do not wish to abide by the terms of the Sleepycat Public License have the option of purchasing another proprietary license for redistribution from Oracle Corporation. This technique is called dual licensing.

Berkeley DB includes compatibility interfaces for some historic Unix database libraries: dbm, ndbm and hsearch (a System V library for creating in-memory hash tables).

[edit] Architecture

Berkeley DB has an architecture notably simpler than that of other database systems like Microsoft SQL Server and Oracle. For example, like SQLite, it does not provide support for network access — programs access the database using in-process API calls. But unlike SQLite, Berkeley DB does not support SQL or any other query language, nor does it support table schemas or table columns. A program accessing the database is free to decide how the data is to be stored in a record. Berkeley DB puts no constraints on the record's data. The record and its key can both be up to four gigabytes long.

Despite having a simple architecture, Berkeley DB supports many advanced database features such as ACID transactions, fine-grained locking, hot backups and replication.

[edit] Editions

Berkeley DB comes in three different editions:

  1. Berkeley DB
  2. Berkeley DB Java Edition
  3. Berkeley DB XML

Each edition has separate database libraries, despite the common branding. The first is the traditional Berkeley DB, written in C.

Berkeley DB Java Edition comprises a pure Java database. Its design resembles that of Berkeley DB without replicating it exactly. It does not offer all the features that traditional Berkeley DB has. However, it has the advantage of being written in pure Java, not requiring any native code; it also has a different architecture, which gives it different performance and concurrency characteristics, which may be advantageous or dis-advantageous depending on the application. It provides two APIs -- one which is based on the Java Collections Framework (an object persistence approach); and one based on the traditional Berkeley DB API. Note that traditional Berkeley DB also supports a Java API, but it does so via JNI and thus requires an installed native library.

The Berkeley DB XML database specialises in the storage of XML documents, supporting XQuery queries. It is implemented as an additional layer on top of Berkeley DB. It supports multiple language bindings, including C and Java (although the latter uses JNI and thus is not a pure Java solution).

[edit] Programs that use Berkeley DB

Berkeley DB provides the underlying storage and retrieval system of several LDAP servers, database systems, and many other proprietary and free/open source applications. Notable software that use Berkeley DB for data storage include:

[edit] Licensing

Oracle Corporation makes versions 2.0 and higher of Berkeley DB available under a dual license.[7] This license is a 2-clause BSD license with an additional copyleft clause similar to the GNU GPL version 2's Section 3, requiring source code of an application using Berkeley DB to be made available for a nominal fee.

Thus, the license depends on how a particular application that uses Berkeley DB is distributed to the public. Software that is not distributed can use the Sleepycat License, as can free and open source software. Proprietary software can use Berkeley DB only under a commercial license agreement between Oracle and the application's publisher.

[edit] References

  1. ^ Olson, Bostic & Seltzer. "Berkeley DB". http://www.usenix.org/events/usenix99/full_papers/olson/olson.pdf. Retrieved October 20, 2009. 
  2. ^ Seltzer & Yigit. "A New Hashing Package for UNIX". http://www.eecs.harvard.edu/margo/papers/usenix91/paper.ps. Retrieved October 20, 2009. 
  3. ^ Brunelli, Mark (March 28, 2005). "A Berkeley DB primer". Enterprise Linux News. http://searchenterpriselinux.techtarget.com/originalContent/0,289142,sid39_gci1071880,00.html. Retrieved December 28, 2008. 
  4. ^ "db(3)". http://www.freebsd.org/cgi/man.cgi?query=db&apropos=0&sektion=0&manpath=FreeBSD+7.1-RELEASE&format=html. Retrieved April 12, 2009. 
  5. ^ "The Sleepycat License". Open Source Initiative. October 31, 2006. http://www.opensource.org/licenses/sleepycat.php. Retrieved December 28, 2008. 
  6. ^ "Licenses". Free Software Foundation. December 10, 2008. http://www.fsf.org/licensing/licenses/index_html#GPLCompatibleLicenses. Retrieved December 28, 2008. 
  7. ^ "Open Source License for Berkeley DB". Oracle Corporation. http://www.oracle.com/technology/software/products/berkeley-db/htdocs/oslicense.html. Retrieved December 28, 2008. "For a license to use the Berkeley DB software under conditions other than those described here, or to purchase support for this software, please contact berkeleydb-info_us@oracle.com." 

[edit] External links