Chapter 8.  Building Third Party APIs

Table of Contents

Building the Go API
Install Oracle Berkeley DB
Build Go Berkeley DB (go-bdb)
Test Go Berkeley DB (go-bdb)
Additional Information
Building Node.js
Additional Information

This chapter provides information on building third party APIs. See the sections below:

Building the Go API

To install Go bindings for Oracle Berkeley DB, get a go-bdb package from You will need an Oracle SSO account. Download your preferred package format; then install it following the steps mentioned in the sections below.

Install Oracle Berkeley DB

Download Berkeley DB 6.2.32 or higher from

  • Windows

    1. Build Berkeley DB from the source code using Minimalist GNU for Windows (MinGW). The easiest way to get access to MinGW is to download and install MinGW-64 ( and MSYS (

      For more information on MSYS and MinGW, see

    2. Start a MSYS terminal and change into the unpacked db-6.2.32 directory.

    3. Execute the following command in the db-6.2.32/build_unix directory.

      ../dist/configure --prefix=/c/bdb/install 
      --enable-cxx --enable-mingw --host=x86_64-w64-mingw32
      make install

    4. Set the following environment variables:

      set CPATH=C:\bdb\install\include
      set LIBRARY_PATH=C:\bdb\install\lib
      set PATH=C:\bdb\install\lib;%PATH%

  • Linux/Posix

    1. Unpack the Berkeley DB source library and change to the directory db-6.2.32/build_unix.

    2. Execute the following command:

      ../dist/configure --prefix=/usr/local/bdb/install --enable-cxx
      make install

    3. Set the following environment variables:

      export CPATH=/usr/local/bdb/install/include
      export LIBRARY_PATH=/usr/local/bdb/install/lib
      export LD_LIBRARY_PATH=/usr/local/bdb/install/lib:$LD_LIBRARY_PATH

Build Go Berkeley DB (go-bdb)

  1. Under your Go installation, change to the directory Go/src and add the directory

  2. Change to

  3. Choose either of the following options:

    1. Checkout go-bdb using the command:

      git clone

    2. Download a .zip or .tar.gz from and unpack it into the directory.

  4. Build go-bdb using the command:

    go build

Test Go Berkeley DB (go-bdb)

  1. Change to the examples directory in Go/src/

  2. Change to the directory HelloWorld.

  3. Enter the command:

    go run HelloWorld.go

    If Hello World! is printed out, then the installation was successful.

Additional Information

  • Go/src/ - Examples of how to use Berkeley DB are located in this directory.

  • HelloWorld - Shows the basics of Berkeley DB, how to create a database and put and get data.

  • Replication - Shows how to set up a replication group and replicate data from the master environment to a replica environment.

  • Bulk - Shows how to do bulk inserts and gets.