Oracle Berkeley DB

Oracle Berkeley DB is the industry-leading open source, embeddable storage engine that provides developers a fast, reliable, local database with zero administration. Oracle Berkeley DB is a library that links directly into your application. Your application makes simple function calls, rather than sending messages to a remote server, eliminating the performance penalty of client-server architectures.

Tell us about the features you would like to see in Berkeley DB. Take the Berkeley DB Future Feature Survey here

Berkeley DB delivers the same robust data storage features as traditional, relational database systems, such as ACID transactions and recovery; locking, multi-process and multi-threading for high concurrency; hot and cold backup; and replication for high availability applications. Berkeley DB can manage databases in memory, on disk or both. Berkeley DB is designed to run in a completely unattended fashion, so all runtime administration is programmatically controlled by the application, not by a human administrator. It has been designed to be to use, fast, scalable, reliable library in a small footprint.

Berkeley DB is designed to store data as opaque byte arrays of data in key/value pairs indexed in one of the available access methods, as seen above. Create, read, update and delete (CRUD) operations on these key/value pairs is done using the BDB get/put or cursor position-based APIs. Berkeley DB also supports the Java Collections and Java Direct Persistence Layer APIs.

Alternatively you may be more comfortable with the SQL query language and relational data types. New in Berkeley DB 11gR2 is the SQL API as shown below.

We've combined the strengths of SQLite with the strengths of Berkeley DB. If you choose the SQL API then the Berkeley DB APIs are completely hidden, your program is written to use the SQLite APIs. Because this is a full SQL database engine you are free to use JDBC, ODBC or any other compatible access layer as well. All the strengths of Berkeley DB are carried forward into the combined product. In some situations you may want to synchronize all or some of the relational data between Oracle Database and Oracle Berkeley DB. This is now possible using the Oracle Mobile Data Sync. Combining these products, from the enterprise Oracle Database to the edge Oracle Berkeley DB, provides the best embedded solution for small-footprint SQL storage in applications, devices, and mobile software.

Berkeley DB is very flexible and puts developers in control of many aspects of its behavior, which allows it to be used across a wide range of applications and as a replacement for custom, home-grown solutions. For example, developers can control how resources are allocated, the amount of memory dedicated to caching records, the on-disk storage structure used for individual tables, durability and isolation guarantees, and replication policies. It includes full source code for easier porting, integration, debugging and optimization.

Berkeley DB provides very fast, reliable and scalable persistence for applications that need to store data locally, run unattended without interruption, and access data in a predictable fashion.

Data Management

Berkeley DB stores data quickly and easily without the overhead found in other databases. Berkeley DB is a C library that runs in the same process as your application, avoiding the interprocess communication delays of using a remote database server. Shared caches keep the most active data in memory, avoiding costly disk access.

  • A library for data management linked into the embedding process
  • Data can be anything from opaque key/value or relational data accessed via SQL
  • Indexed and sequential retrieval (B-tree, Queue, Recno, Hash)
  • Multi-process and multi-threaded support
  • Fine grained and configurable locking for highly concurrent systems
  • Multi-version concurrency control (MVCC)
  • Secondary indexes
  • Duplicate values per key
  • Referential integrity
  • Store data in-memory, on disk or any combination you need
  • Online Btree optimization and compaction
  • Online Btree disk space reclamation
  • Automatic abandoned lock removal
  • Strong encryption of data stored on disk using the AES standard
  • Highly portable, available on many platforms

Transactions

Berkeley DB reliably stores your data when configured to use ACID transactions. Berkeley DB allows a group of database operations to be grouped together such that they either all complete successfully or none complete. In the event of system failure, Berkeley DB recovers automatically, and partially completed transactions will roll back to ensure the system is in a consistent state.

  • ACID - Atomic, Consistent, Isolated and Durable transaction guarantees
  • Selectable isolation levels and durability guarantees, configurable on a per-transaction basis
  • Support for nested transactions
  • Catastrophic and routine failure recovery methods
  • Highly configurable graph and timeout-based deadlock detection
  • Support for application-specific log file records and recovery
  • Hot and cold backups, log file archival, and full database dumps

Replication

When high system scalability and/or availablity are required, Berkeley DB provides a state-of-the-art replication capability to enable a group of systems to service the workload. Replication can be among boards in a chassis, multiple servers in a datacenter or across geographically distributed sites. All aspects of this replication system - data integrity, transactional guarantees, throughput, network transport, and more—are configurable and can be tuned to meet your application's specific requirements.

  • Single master, multiple replica model
  • Automatic failover/re-election
  • PAXOS-compliant election algorithm
  • New replicas can join the group at any time
  • Hot standby
  • Non-stop upgrades
  • Geographically distributed nodes
  • In-memory replication option
  • Client-to-client replication
  • Delayed client synchronization
  • Synchronization throttling
  • Network transport agnostic
  • Proven scalability to thousands of replica nodes
  • Pre-built replication framework for faster development

Deployment

Berkeley DB is very flexible, easy to deploy and easy to integrate. It is a small, approximately 1 MB, library easily installed and configured along with your application. Berkeley DB was designed to operate a completely unattended fashion, so all administrative functions are controlled programmatically. It supports a wide variety of programming languages and operating system platforms. Berkeley DB is proven in millions of deployments, ranging from mission-critical, carrier-class applications to desktop and mobile device applications.

  • Programmatic administration and management - zero human administration
  • Language support (C, C++, Java, Perl, Python, PHP, Tcl, Ruby, etc.)
  • Operating system support (Linux, Windows, BSD UNIX, Solaris, Mac OS/X, VxWorks and any POSIX-compliant operating system)
  • Binary installer for the Microsoft Windows platform
  • Support for memory constrained devices (footprint as small as 600KB)
  • Scalable to terabytes of data, billions of records
  • Source code, test suite included

 


More Resources


Do you contribute to the Berkeley DB community?  Just email us and we'll add you to our list!
Oracle Open World 2014 Banner

In-Memory Replay Banner