Berkeley DB Reference Version 5.3.33

Chapter 11.  Berkeley DB Transactional Data Store Applications

Table of Contents

Transactional Data Store introduction

Why transactions?

Terminology

Handling failure in Transactional Data Store applications

Architecting Transactional Data Store applications

Opening the environment

Opening the databases

Recoverability and deadlock handling

Atomicity

Isolation

Degrees of isolation

Snapshot Isolation

Transactional cursors

Nested transactions

Environment infrastructure

Deadlock detection

Checkpoints

Database and log file archival

Log file removal

Recovery procedures

Hot failover

Using Recovery on Journaling Filesystems

Recovery and filesystem operations

Berkeley DB recoverability

Transaction tuning

Transaction throughput

Transaction FAQ

Transactional Data Store introduction

It is difficult to write a useful transactional tutorial and still keep within reasonable bounds of documentation; that is, without writing a book on transactional programming. We have two goals in this section: to familiarize readers with the transactional interfaces of Berkeley DB and to provide code building blocks that will be useful for creating applications.

We have not attempted to present this information using a real-world application. First, transactional applications are often complex and time-consuming to explain. Also, one of our goals is to give you an understanding of the wide variety of tools Berkeley DB makes available to you, and no single application would use most of the interfaces included in the Berkeley DB library. For these reasons, we have chosen to simply present the Berkeley DB data structures and programming solutions, using examples that differ from page to page. All the examples are included in a standalone program you can examine, modify, and run; and from which you will be able to extract code blocks for your own applications. Fragments of the program will be presented throughout this chapter, and the complete text of the example program for IEEE/ANSI Std 1003.1 (POSIX) standard systems is included in the Berkeley DB distribution.