<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en-us" xmlns="http://www.w3.org/2005/Atom"><title>Simon Willison's Weblog: berkeleydb</title><link href="http://simonwillison.net/" rel="alternate"/><link href="http://simonwillison.net/tags/berkeleydb.atom" rel="self"/><id>http://simonwillison.net/</id><updated>2009-07-16T10:30:14+00:00</updated><author><name>Simon Willison</name></author><entry><title>Keyspace</title><link href="https://simonwillison.net/2009/Jul/16/keyspace/#atom-tag" rel="alternate"/><published>2009-07-16T10:30:14+00:00</published><updated>2009-07-16T10:30:14+00:00</updated><id>https://simonwillison.net/2009/Jul/16/keyspace/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://scalien.com/keyspace/"&gt;Keyspace&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Yet Another Key-Value Store—this one focuses on high availability, with one server in the cluster serving as master (and handling all writes), and the paxos algorithm handling replication and ensuring a new master can be elected should the existing master become unavailable. Clients can chose to make dirty reads against replicated servers or clean reads by talking directly to the master. Underlying storage is BerkeleyDB, and the authors claim 100,000 writes/second. Released under the AGPL.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/agpl"&gt;agpl&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/berkeleydb"&gt;berkeleydb&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/databases"&gt;databases&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/keyspace"&gt;keyspace&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/keyvaluepairs"&gt;keyvaluepairs&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/paxos"&gt;paxos&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/replication"&gt;replication&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/scaling"&gt;scaling&lt;/a&gt;&lt;/p&gt;



</summary><category term="agpl"/><category term="berkeleydb"/><category term="databases"/><category term="keyspace"/><category term="keyvaluepairs"/><category term="paxos"/><category term="replication"/><category term="scaling"/></entry><entry><title>MemcacheDB</title><link href="https://simonwillison.net/2009/Jan/5/memcachedb/#atom-tag" rel="alternate"/><published>2009-01-05T12:37:15+00:00</published><updated>2009-01-05T12:37:15+00:00</updated><id>https://simonwillison.net/2009/Jan/5/memcachedb/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://memcachedb.org/"&gt;MemcacheDB&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
A server that speaks the memcache protocol but uses Berkeley DB for reliable persistent storage. Speedy: 20,000 writes/second and 60,000+ reads/second. Includes a full replication mechanism (with custom memcache protocol commands) based on Berkeley DB’s.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/berkeleydb"&gt;berkeleydb&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/keyvaluepairs"&gt;keyvaluepairs&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/memcache"&gt;memcache&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/memcachedb"&gt;memcachedb&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/replication"&gt;replication&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/scaling"&gt;scaling&lt;/a&gt;&lt;/p&gt;



</summary><category term="berkeleydb"/><category term="keyvaluepairs"/><category term="memcache"/><category term="memcachedb"/><category term="replication"/><category term="scaling"/></entry><entry><title>skipdb</title><link href="https://simonwillison.net/2007/Feb/4/skipdb/#atom-tag" rel="alternate"/><published>2007-02-04T13:09:59+00:00</published><updated>2007-02-04T13:09:59+00:00</updated><id>https://simonwillison.net/2007/Feb/4/skipdb/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://www.dekorte.com/projects/opensource/SkipDB/"&gt;skipdb&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Small, fast BerkeleyDB style database using skip lists, by the creator of the Io programming language.

    &lt;p&gt;&lt;small&gt;&lt;/small&gt;Via &lt;a href="http://programming.reddit.com/info/12prr/comments"&gt;programming.reddit.com&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/berkeleydb"&gt;berkeleydb&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/io"&gt;io&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/skipdb"&gt;skipdb&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/skiplists"&gt;skiplists&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/steve-dekorte"&gt;steve-dekorte&lt;/a&gt;&lt;/p&gt;



</summary><category term="berkeleydb"/><category term="io"/><category term="skipdb"/><category term="skiplists"/><category term="steve-dekorte"/></entry><entry><title>Discovering Berkeley DB</title><link href="https://simonwillison.net/2003/Nov/26/discoveringBerkeleyDB/#atom-tag" rel="alternate"/><published>2003-11-26T02:36:47+00:00</published><updated>2003-11-26T02:36:47+00:00</updated><id>https://simonwillison.net/2003/Nov/26/discoveringBerkeleyDB/#atom-tag</id><summary type="html">
    &lt;p&gt;I'm working on a project at the moment which involves exporting a whole bunch of data out of an existing system. The system is written in Perl and uses Berkeley DB files for most of its storage.&lt;/p&gt;

&lt;p&gt;I'd never done anything with Berkeley DB before, but luckily Python has a &lt;a href="http://www.python.org/doc/current/lib/module-bsddb.html" title="bsddb -- Interface to Berkeley DB library"&gt;module&lt;/a&gt; which seems to do all of the hard work for me:&lt;/p&gt;

&lt;pre&gt;&lt;code class="python"&gt;&amp;gt;&amp;gt;&amp;gt; db = bsddb.btopen('xpand.db')
&amp;gt;&amp;gt;&amp;gt; db.keys()[0:10]
[':archives:index.html', ':art:test.html', ... 
&amp;gt;&amp;gt;&amp;gt; db[':art:test.html']
'template;front.tp\x01\x01'
&amp;gt;&amp;gt;&amp;gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The Berkeley DB libraries are maintained by &lt;a href="http://www.sleepycat.com/"&gt;Sleepycat Software&lt;/a&gt;. Unfortunately, their site is completely saturated with marketing jargon. &lt;q cite="http://www.sleepycat.com/"&gt;Our customers rely on Berkeley DB for fast, scalable, reliable and cost-effective data management for their mission-critical applications&lt;/q&gt;. Great - now what does it &lt;em&gt;do&lt;/em&gt; exactly?&lt;/p&gt;

&lt;p&gt;Some digging around turned up the real information: the &lt;a href="http://www.sleepycat.com/docs/reftoc.html"&gt;Berkeley DB Tutorial and Reference Guide&lt;/a&gt;, which contains pretty much everything you could possible want to know about the technology. It turns out that at a basic level Berkeley DB is just a very high performance, reliable way of persisting dictionary style data structures - anything where a piece of data can be stored and looked up using a unique key. The key and the value can each be up to 4 gigabytes in length and can consist of anything that can be crammed in to a string of bytes, so what you do with it is completely up to you. The only operations available are "store this value under this key", "check if this key exists" and "retrieve the value for this key" so conceptually it's pretty simple - the complicated stuff all happens under the hood.&lt;/p&gt;

&lt;p&gt;It seems like a great alternative to a full on relational database for simple applications, although I'm slightly confused by the license which allows free use for open source products but requires a license for commercial applications. Does that mean that if I use the bsddb Python module in a commercial app I need to get a license from Sleepycat?&lt;/p&gt;
    
        &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/berkeleydb"&gt;berkeleydb&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/perl"&gt;perl&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;&lt;/p&gt;
    

</summary><category term="berkeleydb"/><category term="perl"/><category term="python"/></entry></feed>