This syllabus is provided as a sample. Contact Don Anderson dda@ddanderson.com to customize your course.

Inside BDB Syllabus
  • Day 1: Intro to BDB and API
    • Intro to Berkeley DB [0.5 hr]
      • What is Berkeley DB?
      • Product family
      • Environments : advantages/disadvantages of using one Environment
      • Advantages/Disadvantages of using one Environment
      • Data Storage basics: DB.put, DB.get, DB.del
      • Types of data that can be stored
      • Data Storage basics: cursors
      • Data Storage basics: transactions
      • Data Storage basics: indices
    • Introductory API [1.5 hr]
      • Intro to using API: handles, error returns
      • Using the documentation
      • exercise 1: (open/close a database)
      • Creating and updating records
      • Getting records
      • Deleting records
      • exercise 2: (put/get a record)
    • Kinds of Databases: Btree, Hash, Recno, Queue, Sequence, Heap [1.0 hr]
      • When to use Btree and Hash
      • Btree internals
      • Btree leaf pages
      • Btree Internal nodes
      • Btree disk layout
      • Sizing and capacity
      • Btree sizing
      • Hash internals
      • Choosing keys
      • Duplicate records
      • Recno and Queue
      • Heap
      • Sequences
    • Berkeley DB subsystems [1.0 hr]
      • Multiprocess sharing for subsystems
      • Mpool subsystem
      • Memory pool acts like VM
      • Locking subsystem
      • Logging subsystem
      • Transaction subsystem
      • Use of threads in Berkeley DB
    • Cursors and Indices [2.0 hr]
      • Cursors: first, last
      • Cursor iteration
      • exercise 3 (show all entries)
      • Cursor positioning
      • Delete, update using cursor
      • Secondary (Index) Tables
      • Using Duplicates with Indices
      • Composite Keys
      • exercise 4 (all authors Smith, all authors starting with S)
      • Foreign Key constraints
    • Sequences [1.0 hr]
      • Sequences example
      • Sequence id caching for high performance
      • exercise 5 (allocate a sequence number for each record)
  • Day 2: More API, CDB, Transactions, Utilities
    • Review
    • Other parts of the API [0.5 hr]
      • Using DBT flags for memory management
      • Truncate, remove, rename databases
      • Application specific logging
      • Join
      • Rec Number and Recno
      • Encryption
      • Partial keys or data
    • Common SQL operations in BDB [0.5]
      • Add/update/delete records
      • SELECT WHERE =
      • SELECT WHERE <>
      • JOIN
      • SORT BY
    • Initializing and Configuring Environments [0.5 hr]
      • Open flags
      • Files
      • Other configuration
      • Capturing error output, and other information
      • DB_CONFIG file
    • Building and Configuring BDB [0.5 hr]
      • Building on POSIX
      • Building on Windows
      • Small system builds
      • Upgrades
    • CDB [0.5 hr]
      • Typical uses
      • CDB and modifying cursors
      • CDB and multiple databases
    • Transactions API [1.0 hr]
      • Environment setup, kinds of recovery
      • Nested Transactions
      • Cursors and transactions
      • exercise 6 (transactionally add/remove number of books)
      • Guarantees: logging, disks, checkpoints, recovery
      • Backup strategies
    • Contention and Deadlock [1.5 hr]
      • Forms of deadlock: deadly embrace and upgrade
      • Deadlock diagnosis
      • exercise 7 (deadlock detection)
      • Deadlock correction using RMW
      • Deadlock correction using retries
      • exercise 8 (deadlock correction using retries & RMW)
      • Deadlock correction using MVCC
    • Procedures and Utilities [1.0 hr]
      • Starting/Stopping DB
      • Backup
      • Recovery
      • Checkpoint
      • Archive
      • Upgrade
      • Preloading
      • db_dump
      • db_load
      • exercise 9 (use db_load to load)
      • Combining files from different environments
    • Replication preview [0.5 hr]
  • Day 3: Replication and DBSQL
    • Review
    • Replication (HA) [1.0 hr]
      • Replication concepts
      • Typical replication scenarios
      • Commit acknowledgments
      • Elections
      • Replication performance
      • In memory logging
      • Other replication configuration
      • exercise 10 (adding replication)
    • Events [1.0 hr]
      • Capturing events
      • Using events to monitor master/client
      • Using events to monitor system health
      • exercise 11 (adding events)
    • Channels [1.0 hr]
      • Opening channels
      • Sending sync messages
      • Sending async messages
      • exercise 12 (using channels)
    • Best practices with BDB [0.5]
      • Reliable coding techniques
      • Common Problems
    • DBSQL [2.0 hr]
      • Overview
      • Examples
      • exercise 13 (simple example)
      • Pragmas specific to BDB
      • Performance tuning
      • exercise 14 (adding a pragma)
    • Performance preview [0.5 hr]
  • Day 4: Performance, Miscellany and Wrapup
    • Review
    • Performance [1.0 hr]
      • General Strategies
      • Read Overhead
      • Write Overhead
      • Sizing the Cache
      • Other sizing Parameters
    • Performance Statistics and debugging [1.5 hr]
      • Database stats
      • Memory stats
      • Log stats
      • Lock stats
      • Environment stats
      • Transaction stats
      • Debugging stats
      • db_verify
      • Debugging tools and methodologies
      • Tips for small system builds
      • exercise 15 (performance stats)
    • Performance Checklist [2.0 hr]
      • System Issues
      • Database Structure and usage
      • Per-DB statistics
      • Java specific performance
      • C/C++ specific performance
      • Logging performance
      • Other Environment-wide performance
      • Improving locality
    • Performance Workshop - Open forum [1.5 hr]
      • Your application, your topics
    • Other Products or big features [0.5 hr]
      • Berkeley DB Java Edition (JE)
      • DB XML
      • XA
      • MultiVersion Concurrency Control (MVCC)
    • Summary and closing words [0.5 hr]