World Library  
Flag as Inappropriate
Email this Article

Berkeley DB

Article Id: WHEBN0000004706
Reproduction Date:

Title: Berkeley DB  
Author: World Heritage Encyclopedia
Language: English
Subject: Embedded database, NoSQL, Comparison of network monitoring systems, Comparison of structured storage software, Oracle Corporation
Publisher: World Heritage Encyclopedia

Berkeley DB

Berkeley DB
Original author(s) Margo Seltzer and Keith Bostic of Sleepycat Software
Developer(s) Sleepycat Software, later Oracle Corporation
Initial release 1994 (1994)
Stable release 6.1 / July 10, 2014 (2014-07-10)
Development status production
Written in C
Operating system Unix, Linux, Windows, AIX, Sun Solaris, SCO Unix, Mac OS
Size ~1244 kB compiled on Windows x86
Type Embedded database
License AGPLv3
Website .html/index/berkeley-db/database/products/

Berkeley DB (BDB) is a software library that provides a high-performance embedded database for key/value data. Berkeley DB is written in C with API bindings for C++, C#, PHP, Java, Perl, Python, Ruby, Tcl, Smalltalk, and many other programming languages. BDB stores arbitrary key/data pairs as byte arrays, and supports multiple data items for a single key. Berkeley DB is not a relational database.[1]

BDB can support thousands of simultaneous threads of control or concurrent processes manipulating databases as large as 256 terabytes,[2] on a wide variety of operating systems including most Unix-like and Windows systems, and real-time operating systems. "Berkeley DB" is also used as the common brand name for three distinct products: Oracle Berkeley DB, Berkeley DB Java Edition, and Berkeley DB XML. These three products all share a common ancestry and are currently under active development at Oracle Corporation.


Berkeley DB originated at the University of California, Berkeley as part of BSD, Berkeley's version of the Unix operating system. After 4.3BSD (1986), the BSD developers attempted to remove or replace all code originating in the original AT&T Unix from which BSD was derived. In doing so, they needed to rewrite the Unix database package.[3] A non-AT&T-copyrighted replacement, due to Seltzer and Yigit,[4] attempted to create a disk hash table that performed better than any of the existing Dbm libraries. Berkeley DB itself was first released in 1991 and later included with 4.4BSD.[3] 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[5] 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. Each major release cycle has introduced a single new major feature generally layering on top of the earlier features to add functionality to the product. The 1.x releases focused on managing key/value data storage and are referred to as "Data Store" (DS). The 2.x releases added a locking system enabling concurrent access to data. This is what is known as "Concurrent Data Store" (CDS). The 3.x releases added a logging system for transactions and recovery, called "Transactional Data Store" (TDS). The 4.x releases added the ability to replicate log records and create a distributed highly available single-master multi-replica database. This is called the "High Availability" (HA) feature set. Berkeley DB's evolution has sometimes led to minor API changes or log format changes, but very rarely have database formats changed. Berkeley DB HA supports online upgrades from one version to the next by maintaining the ability to read and apply the prior release's log records.

The FreeBSD and OpenBSD operating systems continue to use Berkeley DB 1.8x for compatibility reasons;[6] Linux-based operating systems commonly include several versions to accommodate for applications still using older interfaces/files.

Starting with the 6.0/12c releases, all Berkeley DB products are licensed under the GNU AGPL.[7] Up until then Berkeley DB was redistributed under the Sleepycat Public License, which is an OSI-approved open-source license as well as an FSF-approved free software license.[8][9] 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 GNU AGPL, or use an older version with 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).


Berkeley DB has an architecture notably simpler than that of other database systems like relational database management systems. For example, like SQLite, it does not provide support for network access — programs access the database using in-process API calls. Oracle added support for SQL in 11g R2 release based on the popular SQLite API by including a version of SQLite in Berkeley DB.[10] There is third party support for PL/SQL in Berkeley DB via a commercial product named Metatranz StepSqlite.[11]

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.


The name "Berkeley DB" is given to three different products:

  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. It contains several database implementations, including a B-Tree and one built around extendible hashing. It supports multiple language bindings, including C/C++, Java (via JNI), C# .NET, Perl and Python.

Berkeley DB Java Edition (JE) is a pure Java database management library. Its design resembles that of Berkeley DB without replicating it exactly, and has a feature set that includes many of those found in the traditional Berkeley DB and others that are specific to the Java Edition. It has a log structured storage architecture, which gives it different performance and concurrency characteristics. Three APIs are available—a Direct Persistence Layer which is "Plain Old Java Objects" (POJO); one which is based on the Java Collections Framework (an object persistence approach); and one based on the traditional Berkeley DB API. The Berkeley DB Java Edition High Availability option (Replication) is available. 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 specializes in the storage of XML documents, supporting XQuery via XQilla. It is implemented as an additional layer on top of (a legacy version of) Berkeley DB and the Xerces library. DB XML is written in C++ and supports multiple language bindings, including C++, Java (via JNI), Perl and Python.

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:


Oracle Corporation makes versions 2.0 and higher of Berkeley DB available under a dual license.[13] The Sleepycat 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.

As of Berkeley DB release 6.0, the Oracle Corporation has relicensed Berkeley DB under the GNU AGPL v3.[14]

As of July 2011, Oracle's list price for non-copyleft Berkeley DB licenses varies between 900 and 13,800 USD per processor.[15] Embedded usage within the Oracle Retail Predictive Application Server (RPAS) does not require an additional license payment.

Sleepycat License

Berkeley DB
DFSG compatible Yes
FSF approved Yes[16]
OSI approved Yes
GPL compatible Yes[16]
Copyleft Yes

Sleepycat License (sometimes referred to as Berkeley Database License or the Sleepycat Public License) is an OSI-approved open source license used by Oracle Corporation for the open-source editions of Berkeley DB, Berkeley DB Java Edition and Berkeley DB XML embedded database products older than version 6.0. (Starting with version 6.0 the open-source editions are instead licensed under the GNU AGPL v3.) The name of this license is derived from the name of the company which commercially sold the Berkeley DB products, Sleepycat Software, which was acquired by Oracle in 2006. Oracle continued to use the name "Sleepycat License" for Berkeley DB, despite not using the term "Sleepycat" in any other documentation until it changed to GNU AGPL with version 6.

According to the Free Software Foundation,[16] it qualifies as a free software license, and is compatible with the GPL.

The license is a strong form of copyleft because it mandates that redistributions in any form not only include the source code of Berkeley DB, but also "any accompanying software that uses the DB software". It is possible to circumvent this strict licensing policy through the purchase of a commercial software license from Oracle Corporation consisting of terms and conditions which are negotiated at the time of sale. This is an example of dual licensing.

The effect of the dual license creates financial exposure for commercial organizations, since there is considerable risk of becoming liable for payment of license fees to Oracle. Some people consider it to be a "sneaky" license. Mike Olson, co-founder and CEO of Sleepycat Software and Cloudera, said that "This is good business if you can get it, but your relationship with your customer begins based on a threat and that's not a really healthy place to start out."[17]


  1. ^ Berkeley DB Reference Guide: What is Berkeley DB not?. (2001-05-31). Retrieved on 2013-09-18.
  2. ^ Berkeley DB Reference Guide: Database limits Retrieved on 2013-09-19
  3. ^ a b
  4. ^
  5. ^
  6. ^
  7. ^ [Berkeley DB Announce] Major Release: Berkeley DB 12gR1 ( Retrieved July 5, 2013.
  8. ^
  9. ^
  10. ^
  11. ^
  12. ^ RCE 35: PVFS Parallel Virtual FileSystem
  13. ^
  14. ^
  15. ^
  16. ^ a b c Various Licenses and Comments about Them - Free Software Foundation
  17. ^ Mike Olson (co-founder and CEO of Sleepycat Software and Cloudera), lecture to Stanford University entrepreneurship students, 2013.11.13

External links

  • Oracle Berkeley DB Site
  • Berkeley DB Programmer's Reference Guide
  • Licensing pitfalls for Oracle Technology Products
  • by Himanshu YadavaThe Berkeley DB Book
  • - Berkeley DB at Launchpad
  • Oracle Licensing Knowledge Net
  • Oracle Berkeley DB Licensing Information
  • Text of the Sleepycat License (old)
This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.

Copyright © World Library Foundation. All rights reserved. eBooks from Project Gutenberg are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.