-r--r--r-- 10208 cdb-20251021/doc/html/index.html raw
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type="text/css">
html{overflow-y:scroll;background-color:#35492a}
body{font-family:"Noto Sans","Droid Sans","DejaVu Sans","Arial",sans-serif;line-height:1.5}
tt,code{background-color:#f0f0f0;font-family:"Noto Sans Mono","Droid Sans Mono","DejaVu Sans Mono","Courier New",monospace,sans-serif;font-size:1em;}
pre{margin-left:3em}
p,ul,ol,blockquote,pre{font-size:1.0em;line-height:1.6}
li p{font-size:1.0em}
blockquote p{font-size:1.0em}
h1{font-size:1.5em}
h2{font-size:1.3em}
h3{font-size:1.0em}
h1 a{text-decoration:none}
table{border-collapse:collapse}
th,td{border:1px solid black}
table a{text-decoration:none}
table tr{font-size:1.0em;line-height:1.6em}
table tr{font-size:1.0em;line-height:1.5}
tbody tr:nth-child(12n+1){background-color:#f0ffff}
tbody tr:nth-child(12n+2){background-color:#f0ffff}
tbody tr:nth-child(12n+3){background-color:#f0ffff}
tbody tr:nth-child(12n+4){background-color:#f0ffff}
tbody tr:nth-child(12n+5){background-color:#f0ffff}
tbody tr:nth-child(12n+6){background-color:#f0ffff}
tbody tr:nth-child(12n+7){background-color:#fffff0}
tbody tr:nth-child(12n+8){background-color:#fffff0}
tbody tr:nth-child(12n+9){background-color:#fffff0}
tbody tr:nth-child(12n+10){background-color:#fffff0}
tbody tr:nth-child(12n+11){background-color:#fffff0}
tbody tr:nth-child(12n+12){background-color:#fffff0}
#headline{display:block;margin:0;padding:0;color:#ffffff;background-color:#35492a}
#headline .text{font-weight:bold;font-size:1.0em}
#headline input{display:none}
#nav ul{margin:0;padding:0}
#nav li{list-style-type:none;margin:0;padding:0}
.navtop{padding-bottom:0.5em;font-weight:bold;font-size:1.0em}
.navtop{background-color:#35492a;color:#ffffff}
#nav .here{background-color:#35492a;color:#ffffff}
#nav .away{background-color:#35492a;color:#ffffff}
#nav .away a{text-decoration:none;display:block;color:#ffffff}
#nav .away a:hover,.away a:active{text-decoration:underline}
#hidemenu{visibility:hidden;display:none;overflow:hidden;position:fixed;top:0;left:0;height:100%;width:100%}
.main{padding:5px}
.main{background-color:#ffffff}
.pagetitle{font-size:1.4em;font-weight:bold}
@media only screen and (min-width:512px) {
.navtop{padding-top:5px}
#headline{top:0;margin:0;width:160px;height:100%;position:fixed;overflow:auto}
#headline .noselect{display:none}
#headline #nav{visibility:visible;display:block;width:auto;height:auto}
.main{margin-left:170px}
#headline #hidemenu{visibility:hidden}
}
@media not screen and (min-width:512px) {
#headline .noselect{-webkit-user-select:none;-ms-user-select:none;user-select:none;}
#headline #nav #navbot{visibility:hidden;position:fixed;top:0;left:-70%;z-index:2;transition:0.2s;margin:0;padding:0}
#headline input:checked ~ #nav #navbot{height:100%;position:fixed;top:0;left:0;visibility:visible;display:block;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;vertical-align:center;font-size:1.0em;width:70%;overflow:auto}
#headline input:checked ~ #hidemenu{visibility:visible;display:block;background:black;opacity:0.3;z-index:1}
}
</style>
<title>
cdb: Intro</title>
</head>
<body>
<label id=headline>
<input type=checkbox />
<nav id=nav>
<div class=navtop>
<span class=noselect>≡</span>
cdb</div>
<ul id=navbot>
<li class=here>Intro
</li><li class=away><a href=download.html>Download</a>
</li><li class=away><a href=install.html>Install</a>
</li><li class=away><a href=test.html>Test</a>
</li><li class=away><a href=cdb.html>Read API</a>
</li><li class=away><a href=cdbget.html>cdbget</a>
</li><li class=away><a href=cdbdump.html>cdbdump</a>
</li><li class=away><a href=cdbmake.html>cdbmake</a>
</li><li class=away><a href=cdbmake-12.html>cdbmake-12</a>
</li><li class=away><a href=cdbmake-sv.html>cdbmake-sv</a>
</li><li class=away><a href=cdbstats.html>cdbstats</a>
</li><li class=away><a href=cdbtest.html>cdbtest</a>
</li><li class=away><a href=format.html>Format</a>
</li><li class=away><a href=license.html>License</a>
</li></ul></nav>
<div id=hidemenu></div>
</label>
<div class=main>
<div class=pagetitle>cdb: Intro</div>
<p>cdb is a fast, reliable, simple package
for creating and reading constant databases.
The cdb database structure provides several features:</p>
<ul>
<li>
<p><strong>Fast lookups:</strong>
A successful lookup in a large database
normally takes just two disk accesses.
An unsuccessful lookup takes only one.</p>
</li>
<li>
<p><strong>Low overhead:</strong>
A database uses 2048 bytes (or 4096 bytes for cdb64),
plus 24 bytes per record (or 48 bytes per record for cdb64),
plus the space for keys and data.</p>
</li>
<li>
<p><strong>No random limits:</strong>
cdb handles any database up to 4 gigabytes
(or up to an exabyte for cdb64).
There are no other restrictions.
Records are streamed and don't have to fit into memory.
Databases are stored in a machine-independent format
(one format for cdb, one format for cdb64).</p>
</li>
<li>
<p><strong>Fast atomic database replacement:</strong>
<code>cdbmake</code> rewrites an entire database
much more quickly than other hashing packages.
Database replacement is safe against system crashes.
Readers don't pause during a rewrite:
they continue transparently using the old database
until the new database is in place.</p>
</li>
<li>
<p><strong>Fast database dumps:</strong>
<code>cdbdump</code> prints the contents of a database
in <code>cdbmake</code>-compatible format.</p>
</li>
</ul>
<p>Latest release: <a href="download.html">20251021</a>.</p>
<h2>Author</h2>
<p><a href="https://cr.yp.to/djb.html">D. J. Bernstein</a></p>
<h2>More support for cdb</h2>
<p>More packages saying that they provide tools for you to use cdb format
(and in some cases cdb64 format):</p>
<ul>
<li>
<p><a href="https://github.com/pcarrier/cdb64">cdb64</a>
from Pierre Carrier:
Tweak of cdb-0.75 to support cdb64.</p>
</li>
<li>
<p><a href="https://github.com/ever0de/cdb64-rs">cdb64-rs</a>
from Jiseok Choi:
Rust implementation of cdb64,
plus wrappers for C, Node.js, and Python.</p>
</li>
<li>
<p><a href="https://metacpan.org/pod/CDB_File">CDB_File</a>:
from Tim Goodwin, Matt Sergeant, and Todd Rinaldo:
Perl wrapper around cdb.</p>
</li>
<li>
<p><a href="https://rubygems.org/gems/cdb-full/versions/0.6?locale=en">cdb-full</a>
from Kazuteru Okahashi and Rich Lane:
Ruby wrapper around cdb.</p>
</li>
<li>
<p><a href="https://metacpan.org/pod/CDB::TinyCDB">CDB::TinyCDB</a>
from Alex J. G. Burzyński:
Perl wrapper around TinyCDB.</p>
</li>
<li>
<p><a href="https://github.com/jbarham/cdb">go-cdb-1</a>:
from John Barham:
Go implementation.</p>
</li>
<li>
<p><a href="https://github.com/colinmarc/cdb">go-cdb-2</a>
from Colin Marc:
Go implementation.</p>
</li>
<li>
<p><a href="https://pkg.go.dev/github.com/chrislusf/cdb64">go-cdb64</a>
from Chris Lu:
Go implementation of cdb64.</p>
</li>
<li>
<p><a href="https://github.com/howerj/cdb">howerj-cdb</a>
from Richard James Howe:
C implementation.</p>
</li>
<li>
<p><a href="https://hackage.haskell.org/package/hs-cdb">hs-cdb</a>
from Adam Smith:
Haskell implementation.</p>
</li>
<li>
<p><a href="https://www.fefe.de/libowfat/">libowfat</a>:
C implementation from Felix von Leitner (as part of a broader library).</p>
</li>
<li>
<p>luacdb from Taj Khattra:
Lua wrapper around cdb.</p>
</li>
<li>
<p><a href="https://github.com/asb/lua-tinycdb">lua-tinycdb</a>
from A. S. Bradbury:
Lua wrapper around TinyCDB.</p>
</li>
<li>
<p><a href="https://gerrit.wikimedia.org/g/cdb/">php-cdb</a>:
PHP implementation.</p>
</li>
<li>
<p><a href="https://hackage.haskell.org/package/pure-cdb">pure-cdb</a>
from Boris Sukholitko:
Haskell implementation.</p>
</li>
<li>
<p><a href="https://www.unixuser.org/~euske/doc/cdbinternals/pycdb.py.html">pycdb</a>
from Yusuke Shinyama:
Python implementation.</p>
</li>
<li>
<p><a href="https://github.com/acg/python-cdb">python-cdb</a>
from Mike Pomraning and Alan Grow:
Python wrapper around cdb.</p>
</li>
<li>
<p><a href="https://python-pure-cdb.readthedocs.io/en/latest/">python-pure-cdb</a>
from David Wilson:
Python implementation.
Also supports cdb64.</p>
</li>
<li>
<p><a href="https://crates.io/crates/cdb">rust-cdb</a>
from Bruce Guenter:
Rust implementation.</p>
</li>
<li>
<p><a href="https://www.strangegizmo.com/products/sg-cdb/">sg-cdb</a>
from Michael Alyn Miller:
Java implementation.</p>
</li>
<li>
<p><a href="https://swiftpackageindex.com/aisk/swift-cdb">swift-cdb</a>:
Swift wrapper around howerj-cdb.</p>
</li>
<li>
<p><a href="https://www.corpit.ru/mjt/tinycdb.html">TinyCDB</a>
from Michael Tokarev:
C implementation.</p>
</li>
</ul>
<p>Examples of applications using cdb format:
<a href="https://cr.yp.to/djbdns.html">djbdns</a>.
<a href="https://www.dnsdist.org/index.html">dnsdist</a>.
<a href="https://www.exim.org/exim-html-3.10/doc/html/spec_2.html">Exim</a>.
<a href="https://cr.yp.to/fastforward.html">fastforward</a>.
<a href="https://github.com/rra/krb5-strength">krb5-strength</a>.
<a href="https://cr.yp.to/mess822.html">mess822</a>.
<a href="https://www.postfix.org/CDB_README.html">Postfix</a>.
<a href="https://smarden.org/qconfirm/cdb">qconfirm</a>.
<a href="https://cr.yp.to/qmail.html">qmail</a>.
<a href="https://cr.yp.to/ucspi-tcp.html">ucspi-tcp</a>.
Examples of comparative benchmarks:
<a href="https://www.perlmonks.org/?node_id=152749">2002</a>.
<a href="https://web.archive.org/web/20040423185201/http://qdbm.sourceforge.net:80/benchmark.pdf">2004</a>.
<a href="https://dbmx.net/tokyocabinet/benchmark.pdf">2008</a>.
<a href="https://www.dmo.ca/blog/benchmarking-hash-databases-on-large-data/">2009</a>.
<a href="https://gist.github.com/epitron/1625d93d0b82c32e7395">2014</a>.
<a href="https://www.programmer.ie/post/acdb/">2016</a>.</p>
<p>Another spinoff of cdb allowing constant databases beyond 4GB is
Spotify's <a href="https://engineering.atspotify.com/2013/9/sparkey">sparkey</a>.</p><hr><font size=1><b>Version:</b>
This is version 2025.10.21 of the "Intro" web page.
</font>
</div>
</body>
</html>