Oracle Berkeley DB SQL API
Oracle Berkeley DB 11g includes, for the first time, support for SQL access to relational data. The success of the SQL language and relational data model has moved beyond the data center to the edges of enterprise infrastructure and into consumer, enterprise, and mobile devices. The SQL language and relational model provide tremendous value to developers.
This version of Berkeley DB provides a drop-in compatible version of the SQLite lightweight relational database library, modified to use the Berkeley DB data storage engine. The resulting combined product has the familiar feel of SQLite and the robust, scalable, concurrent storage features of Berkeley DB. Combined, this represents the best-of-breed minimum footprint embedded SQL database engine.
Berkeley DB and SQLite link together via a new adapter layer that hides all the Berkeley DB APIs underneath the SQLite interface. Thus, applications written to the SQLite version 3 API can switch to using Oracle Berkeley DB with no code changes, by re-linking against the Berkeley DB SQLite library. The application-level behavior of the two products is identical, but the advanced features of Berkeley DB provide SQLite applications improved performance, concurrency, scalability, and reliability.
Oracle Berkeley DB has, for over 15 years, focused on unstructured transactional key/value data storage. Its key/value-based API is flexible enough to support almost any structured or semi-structured, data storage model. Berkeley DB has provided storage services for products ranging from configuration files to email, from delivery distributed caches to hierarchical directory storage, from shopping carts to RSS archives. It was the first transactional table type for MySQL pre-dating InnoDB. This new use, as the storage engine below the SQL processing logic of SQLite, is a natural fit for Berkeley DB.
Berkeley DB is not exposed to the end-user. It is totally hidden below the SQLite APIs. It acts as the storage engine in place of SQLite's own BTREE. An application written to use the SQLite version 3 API can switch to Oracle Berkeley DB with no code changes, simply re-link against Berkeley DB. In addition, many advanced options and tuning and performance-related features found in Berkeley DB are available via simple configuration commands stored with the database files. We intend to donate any fixes or enhancements we make to the SQLite code above the Berkeley DB adapter back into the SQLite code base.
Technical Resources
- White paper: Oracle Berkeley DB SQL API vs. SQLite API – A Technical & Performance Evaluation (PDF)
- White paper: Oracle Berkeley DB SQL API vs. SQLite API – Integration, Benefits and Differences (PDF)
- Resources for: BDB vs SQLite comparisons (.ZIP)