Need help with cdb?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

jbarham
220 Stars 15 Forks BSD 2-Clause "Simplified" License 22 Commits 3 Opened issues

Description

Pure Go implementation of D. J. Bernstein's cdb constant database library.

Services available

!
?

Need anything else?

Contributors list

# 332,480
HTML
Go
stripe
payment...
17 commits
# 14,717
tcl
datamap...
dao
React
2 commits
# 417,005
Ada
source
Common ...
Shell
1 commit

cdb

This is a Go package to read and write cdb ("constant database") files.

The cdb file format is a machine-independent format with the following features:

  • Fast lookups: A successful lookup in a large database normally takes just two disk accesses. An unsuccessful lookup takes only one.
  • Low overhead: A database uses 2048 bytes, plus 24 bytes per record, plus the space for keys and data.
  • No random limits: cdb can handle any database up to 4 gigabytes. There are no other restrictions; records don't even have to fit into memory.

See the original cdb specification and C implementation by D. J. Bernstein at http://cr.yp.to/cdb.html.

Installation

Assuming you have a working Go environment, installation is simply:

go get github.com/jbarham/cdb

The package documentation can be viewed online at https://pkg.go.dev/github.com/jbarham/cdb or on the command line by running

go doc github.com/jbarham/cdb
.

The included self-test program

cdb_test.go
illustrates usage of the package.

Utilities

The cdb package includes ports of the programs

cdbdump
and
cdbmake
from the original implementation.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.