Going Off the Beaten DB Path (cont'd)
Designed for Programmers, not DBAs
Berkeley DB is designed for use by programmers, not database administrators, and definitely not for end users. It doesn't use Structured Query Language (SQL), the lingua franca of most database systems. Instead, it uses a set of APIs written in various programming languages, including C, C++, Java, and Perl. Developers use these APIs to do all the things other databases do with SQL: create tables, add and delete data, retrieve records, and so forth. All database functions, such as backup, recovery, locking, and user permissions are performed programmatically.
One of Berkeley DB's primary characteristics is that it's lean and fast. It dispenses with graphical UIs, flashy reporting tools, and just about everything else that might get in the way of maximum performance. It's tiny, almost amazingly so-well under 1 megabyte for the whole package. It's not what you'd call user-friendly, and the initial learning curve can be steep, but if you're fed up with dealing with the overhead that comes with larger database systems and you're willing to invest the time it takes to become proficient with it, Berkeley DB can be a dream come true.
As an embedded system, it's designed for applications that use data storage and retrieval in mid-stream, such as Web applications written in Perl. Referring to a Berkeley DB file in a web application is an alternative to database access with ODBC, which can involve performance-damaging overhead.
Another powerful Berkeley DB feature is the flexibility of its data types and structures. Some database users tend to think of a database table as a kind of spreadsheet on steroids - two-dimensional rows and columns, nothing more. A Berkeley DB table, on the other hand, can contain any data structure you can create using the tools found in C or Perl or whatever language you prefer. If you want to create a table with an array of hashes of references to other hashes, you can do it.
Berkeley DB comes in three flavors: Berkeley DB Data Store, a basic, single-user implementation; Berkeley DB Concurrent Data Store, which adds multi-user support; and Berkeley DB Transactional Data Store, which adds logging, transactions, and several other advanced features. All three are open source and available free of charge, subject to licensing restrictions. See the Sleepycat Web site for more product information.